Showing posts with label struggling. Show all posts
Showing posts with label struggling. Show all posts

Tuesday, March 13, 2012

struggling asp.net novice

hi all

I am currently building an asp.net website for uni. I have a header ascx file with hyperlink buttons which i would like to be able to click on to bring up a list of categories which will be hyperlinks pulling up product data from my access database, i have been advised multidimentional arrays would be good, however i don't know where to start, can any body help?

thanks Angela

Crying [:'(]

Struggling - 'static' vs 'void' etc?

I am really struggling to conceptually understand classes in C# especially
the use of the strange keywords 'static' 'void' and 'override'...
Is there a 'idiots' way of understanding these concepts broadly before even
touching a line of code...
Thanks
JasonGoogle: "C# Class Design"
WROX "C# Class Design - Coding Effective Classes Handbook" is what you need.
<%= Clinton Gallagher
METROmilwaukee "Regional Information Services"
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
<jason@.catamaranco.com> wrote in message
news:eawJ2zs6EHA.1260@.TK2MSFTNGP12.phx.gbl...
> I am really struggling to conceptually understand classes in C# especially
> the use of the strange keywords 'static' 'void' and 'override'...
> Is there a 'idiots' way of understanding these concepts broadly before
even
> touching a line of code...
>
> Thanks
> Jason
>
Static = non-object
Void = a method that does not return a value
Override = when you decide to discard the origins and implenet your own.
The better definitions can be viewed here:
http://msdn.microsoft.com/library/d...keywords_pg.asp
John
<jason@.catamaranco.com> wrote in message
news:eawJ2zs6EHA.1260@.TK2MSFTNGP12.phx.gbl...
>I am really struggling to conceptually understand classes in C# especially
> the use of the strange keywords 'static' 'void' and 'override'...
> Is there a 'idiots' way of understanding these concepts broadly before
> even
> touching a line of code...
>
> Thanks
> Jason
>
This should help get you started.
http://www.geocities.com/jeff_louie/oop.htm
Regards,
Jeff
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
Thanks guys...!
<jason@.catamaranco.com> wrote in message
news:eawJ2zs6EHA.1260@.TK2MSFTNGP12.phx.gbl...
> I am really struggling to conceptually understand classes in C# especially
> the use of the strange keywords 'static' 'void' and 'override'...
> Is there a 'idiots' way of understanding these concepts broadly before
even
> touching a line of code...
>
> Thanks
> Jason
>

Struggling - static vs void etc?

I am really struggling to conceptually understand classes in C# especially
the use of the strange keywords 'static' 'void' and 'override'...

Is there a 'idiots' way of understanding these concepts broadly before even
touching a line of code...

Thanks
JasonGoogle: "C# Class Design"
WROX "C# Class Design - Coding Effective Classes Handbook" is what you need.

--
<%= Clinton Gallagher
METROmilwaukee "Regional Information Services"
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/

<jason@.catamaranco.com> wrote in message
news:eawJ2zs6EHA.1260@.TK2MSFTNGP12.phx.gbl...
> I am really struggling to conceptually understand classes in C# especially
> the use of the strange keywords 'static' 'void' and 'override'...
> Is there a 'idiots' way of understanding these concepts broadly before
even
> touching a line of code...
>
> Thanks
> Jason
Static = non-object
Void = a method that does not return a value
Override = when you decide to discard the origins and implenet your own.

The better definitions can be viewed here:
http://msdn.microsoft.com/library/d...keywords_pg.asp

John

<jason@.catamaranco.com> wrote in message
news:eawJ2zs6EHA.1260@.TK2MSFTNGP12.phx.gbl...
>I am really struggling to conceptually understand classes in C# especially
> the use of the strange keywords 'static' 'void' and 'override'...
> Is there a 'idiots' way of understanding these concepts broadly before
> even
> touching a line of code...
>
> Thanks
> Jason
This should help get you started.

http://www.geocities.com/jeff_louie/oop.htm

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Thanks guys...!
<jason@.catamaranco.com> wrote in message
news:eawJ2zs6EHA.1260@.TK2MSFTNGP12.phx.gbl...
> I am really struggling to conceptually understand classes in C# especially
> the use of the strange keywords 'static' 'void' and 'override'...
> Is there a 'idiots' way of understanding these concepts broadly before
even
> touching a line of code...
>
> Thanks
> Jason
I found this sample chapter on C# extremly helpful...as a newbie I have
been searching for a 'magic' way to instantly digesting the 'broad' concepts
in C# this tutorial helped me a lot:

http://www.joegrip.com/csharp-course.html (see flash C#)

- Jason
<jason@.catamaranco.com> wrote in message
news:eawJ2zs6EHA.1260@.TK2MSFTNGP12.phx.gbl...
> I am really struggling to conceptually understand classes in C# especially
> the use of the strange keywords 'static' 'void' and 'override'...
> Is there a 'idiots' way of understanding these concepts broadly before
even
> touching a line of code...
>
> Thanks
> Jason

Struggling With Concept

Hi Folks,
As you may know I'm new to ASP.NET and Im having trouble
grappling with one concept.
If I create a user control and place it on a page I can access its public
properties through a pre-render block, But I cant access its public
properties via code. In say the Page_Load event.
Surely if the control is registered, when the Page_Load Loads, it must have
access to the UserControl Object otherwise whats the point?
Please tell me where Im going wrong !
CheersHi,
What you need to do is access the usercontrol directly, for example: -
Page_Load(...)
{
((myusercontroltype)this.FindControl("UserControlInstance1")).<Property>
}
Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.com
Thank you so much for that, I knew it should be possible, but I must have
missed that Method somehow. I tried this instantly and it work just
absolutely fine.
Thanks Again for your help.
Best Regards - OHM
"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote i
n
message news:caep52$9ft@.odah37.prod.google.com...
> Hi,
> What you need to do is access the usercontrol directly, for example: -
> Page_Load(...)
> {
> ((myusercontroltype)this.FindControl("UserControlInstance1")).<Property>
> }
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
> http://www.myservicescentral.com
>
You can also declare the control at the module level and use the withevents
keyword to expose its events if they are needed. Then you can reference the
control via the code editor.
#Region " Web Form Designer Generated Code "
'Instantiate the control here and you can use it throughout the page by
name.
Protected WithEvents MyUserControl As New MyUserControl
'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
With Me.MyUserControl
.DataSource = SomeDataSource
.Text = "SomeValue"
.SomeOtherProperty = "SomeOtherValue"
End With
End If
End Sub
"One Handed Man ( OHM#)" <news.microsoft.com> wrote in message
news:uazb75GUEHA.1048@.tk2msftngp13.phx.gbl...
> Hi Folks,
> As you may know I'm new to ASP.NET and Im having trouble
> grappling with one concept.
> If I create a user control and place it on a page I can access its public
> properties through a pre-render block, But I cant access its public
> properties via code. In say the Page_Load event.
> Surely if the control is registered, when the Page_Load Loads, it must
> have
> access to the UserControl Object otherwise whats the point?
> Please tell me where Im going wrong !
> Cheers
>

Struggling With Concept

Hi Folks,
As you may know I'm new to ASP.NET and Im having trouble
grappling with one concept.

If I create a user control and place it on a page I can access its public
properties through a pre-render block, But I cant access its public
properties via code. In say the Page_Load event.

Surely if the control is registered, when the Page_Load Loads, it must have
access to the UserControl Object otherwise whats the point?

Please tell me where Im going wrong !

CheersYou can also declare the control at the module level and use the withevents
keyword to expose its events if they are needed. Then you can reference the
control via the code editor.

#Region " Web Form Designer Generated Code "
'Instantiate the control here and you can use it throughout the page by
name.
Protected WithEvents MyUserControl As New MyUserControl

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
With Me.MyUserControl
.DataSource = SomeDataSource
.Text = "SomeValue"
.SomeOtherProperty = "SomeOtherValue"
End With
End If
End Sub

"One Handed Man ( OHM#)" <news.microsoft.com> wrote in message
news:uazb75GUEHA.1048@.tk2msftngp13.phx.gbl...
> Hi Folks,
> As you may know I'm new to ASP.NET and Im having trouble
> grappling with one concept.
> If I create a user control and place it on a page I can access its public
> properties through a pre-render block, But I cant access its public
> properties via code. In say the Page_Load event.
> Surely if the control is registered, when the Page_Load Loads, it must
> have
> access to the UserControl Object otherwise whats the point?
> Please tell me where Im going wrong !
> Cheers

Struggling With Concept

Hi,

What you need to do is access the usercontrol directly, for example: -

Page_Load(...)
{

((myusercontroltype)this.FindControl("UserControlInstance1")).<Property>
}

Hth,
Phil Winstanley
Microsoft ASP.NET MVP
http://www.myservicescentral.comThank you so much for that, I knew it should be possible, but I must have
missed that Method somehow. I tried this instantly and it work just
absolutely fine.

Thanks Again for your help.

Best Regards - OHM

"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote in
message news:caep52$9ft@.odah37.prod.google.com...
> Hi,
> What you need to do is access the usercontrol directly, for example: -
> Page_Load(...)
> {
> ((myusercontroltype)this.FindControl("UserControlInstance1")).<Property>
> }
> Hth,
> Phil Winstanley
> Microsoft ASP.NET MVP
> http://www.myservicescentral.com

Struggling with querystring calling in formviews

Hi,

I am having trouble getting querystrings to show up in textboxes in a formview control. I know you have to dig deeper to find the textboxes, but I thought I had done so, but it doesnt seem to work at the moment..

I am currently getting:

'Buyers_Shippingdetails' does not contain a definition for 'SellerusernameTextBox'

referring to:

Line 28: this.SellerusernameTextBox.Text = Request.QueryString["sellername"];

as an error.. my code is:

protected void FormView1_Load(object sender, EventArgs e)
{
TextBox SellerusernameTextBox = FormView1.FindControl("SellerusernameTextBox") as TextBox;

TextBox NameitemTextBox = FormView1.FindControl("NameitemTextBox") as TextBox;

TextBox prodIDTextBox = FormView1.FindControl("prodIDTextBox") as TextBox;

this.SellerusernameTextBox.Text = Request.QueryString["sellername"];
this.NameitemTextBox.Text = Request.QueryString["itemname"];
this.prodIDTextBox.Text = Request.QueryString["proID"];
}
}

Thanks if someone can help! I am stuck with the same problem on a couple of pages.

Any advice is welcome!

Cheers,

Jon

First off, remove the "this" qualifier from in fron tof your variables. These are method-level variables and don't require qualifiers. Also, I'd recommend you move your code to the FormView.DataBound event.

protected void FormView1_DataBound(object sender, EventArgs e){TextBox SellerusernameTextBox = FormView1.FindControl("SellerusernameTextBox")as TextBox;TextBox NameitemTextBox = FormView1.FindControl("NameitemTextBox")as TextBox;TextBox prodIDTextBox = FormView1.FindControl("prodIDTextBox")as TextBox;if (SellerusernameTextBox ==null) {return; }if (NameitemTextBox ==null) {return; }if (prodIDTextBox ==null) {return; }SellerusernameTextBox.Text = Request.QueryString["sellername"];NameitemTextBox.Text = Request.QueryString["itemname"];prodIDTextBox.Text = Request.QueryString["proID"];}

Just the trick.

Thanks alot, as always.

Jon