Basic Questions About ASP.NET
-
I am still learning about ASP.NET. I have read many articles on the Internet about how ASP.NET creates hidden field __EVENTARGUMENT and __EVENTTARGET. I am using VS2005, ASP.NET 2005 (I suspect w/VS2005) and C#. I create the simplest test web site with one Button as a server control and an OnClick handler. I examine the source it generates in Internet Explorer. I see NO __EVENTARGUMENT and __EVENTTARGET fields in the HTML source. Where are they? There is an __EVENTVALIDATION field. If I use the EnableEventValidtion="false" then it disappears. But never do I see the __EVENTARGUMENT and __EVENTTARGET in the HTML. What is going on? Thanks! Mark
-
I am still learning about ASP.NET. I have read many articles on the Internet about how ASP.NET creates hidden field __EVENTARGUMENT and __EVENTTARGET. I am using VS2005, ASP.NET 2005 (I suspect w/VS2005) and C#. I create the simplest test web site with one Button as a server control and an OnClick handler. I examine the source it generates in Internet Explorer. I see NO __EVENTARGUMENT and __EVENTTARGET fields in the HTML source. Where are they? There is an __EVENTVALIDATION field. If I use the EnableEventValidtion="false" then it disappears. But never do I see the __EVENTARGUMENT and __EVENTTARGET in the HTML. What is going on? Thanks! Mark
You're asking the wrong questions. If all you've done is create a page with a button then you need to spend time learning stuff like the page lifecycle, and how to use viewstate, etc. You don't need to worry about if a hidden field you read about is there or not, who cares ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
You're asking the wrong questions. If all you've done is create a page with a button then you need to spend time learning stuff like the page lifecycle, and how to use viewstate, etc. You don't need to worry about if a hidden field you read about is there or not, who cares ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
I find this response very curious. I have read many, many articles about viewstate and page lifecycle. About init phase, page load phase etc. I am writing a fairly involved application in which I am creating some dynamic controls. It works well to a point and then some simple OnClicks just stop working. I have struggled for quite a while trying to explain this. At this point, I was wondering why I see no _EVENTTARGET and __EVENTARGUMENT fields, like some many articles tell me to expect. Maybe this is a symptom of a large problem?? It amazes me how so many times respondees on this forum must point out how little the poster knows. Sorry to imply I know so little about ASP.NET. I guess I actually know more than I implied. Could somebody be kind enough to address my original question? Thanks, Mark
-
I find this response very curious. I have read many, many articles about viewstate and page lifecycle. About init phase, page load phase etc. I am writing a fairly involved application in which I am creating some dynamic controls. It works well to a point and then some simple OnClicks just stop working. I have struggled for quite a while trying to explain this. At this point, I was wondering why I see no _EVENTTARGET and __EVENTARGUMENT fields, like some many articles tell me to expect. Maybe this is a symptom of a large problem?? It amazes me how so many times respondees on this forum must point out how little the poster knows. Sorry to imply I know so little about ASP.NET. I guess I actually know more than I implied. Could somebody be kind enough to address my original question? Thanks, Mark
MarkMokris wrote:
It amazes me how so many times respondees on this forum must point out how little the poster knows.
As you say, you told me you were new to ASP.NET. I just believed you.
MarkMokris wrote:
. I am writing a fairly involved application in which I am creating some dynamic controls. It works well to a point and then some simple OnClicks just stop working.
OK, so THIS is the real question ? Your original post said 'I made a page with a button and cannot see a field in the page that I read about online'. Your original post and this one, are basically unrelated. How are you creating dynamic controls ? The reason for an event to not work, is that your controls are created too late OR your control tree changes, both of which will mean that viewstate is not restored because the control tree is not identical before page_load. FWIW CP uses ASP.NET and I just searched the source of this page for the fields you mention. Instead of looking for random things based on your online reading, you should focus on your actual problem, which is viewstate not being restored, from the sound of it.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
MarkMokris wrote:
It amazes me how so many times respondees on this forum must point out how little the poster knows.
As you say, you told me you were new to ASP.NET. I just believed you.
MarkMokris wrote:
. I am writing a fairly involved application in which I am creating some dynamic controls. It works well to a point and then some simple OnClicks just stop working.
OK, so THIS is the real question ? Your original post said 'I made a page with a button and cannot see a field in the page that I read about online'. Your original post and this one, are basically unrelated. How are you creating dynamic controls ? The reason for an event to not work, is that your controls are created too late OR your control tree changes, both of which will mean that viewstate is not restored because the control tree is not identical before page_load. FWIW CP uses ASP.NET and I just searched the source of this page for the fields you mention. Instead of looking for random things based on your online reading, you should focus on your actual problem, which is viewstate not being restored, from the sound of it.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
I really appreciate your help Christian. To avoid more confusion, let me restate my question. I have a fairly involved ASP.NET application in VS2005 which creates dynamic controls. I have a problem in which after a while some OnClicks stop working. I have tried everything and believe I have read every article I can find about viewstate and the ASP.NET page lifecycle. I still don't know what is wrong. I did notice that there are no __EVENTTARGET and __EVENTARGUMENT hidden fields are being created, yet every funamental article on ASP.NET says they will be created. So, I created the SIMPLEST application I could as a test. Even in the SIMPLEST website with one Button server control and an OnClick event, still no __EVENTTARGET and __EVENTARGUMENT hidden fields are created. Is there an explanation? Thanks, Mark
-
I really appreciate your help Christian. To avoid more confusion, let me restate my question. I have a fairly involved ASP.NET application in VS2005 which creates dynamic controls. I have a problem in which after a while some OnClicks stop working. I have tried everything and believe I have read every article I can find about viewstate and the ASP.NET page lifecycle. I still don't know what is wrong. I did notice that there are no __EVENTTARGET and __EVENTARGUMENT hidden fields are being created, yet every funamental article on ASP.NET says they will be created. So, I created the SIMPLEST application I could as a test. Even in the SIMPLEST website with one Button server control and an OnClick event, still no __EVENTTARGET and __EVENTARGUMENT hidden fields are created. Is there an explanation? Thanks, Mark
I have looked at several pages, including several on CP and several on my own site, and cannot find ANY with __EVENTTARGET in them. I think you're barking up the wrong tree there.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
I have looked at several pages, including several on CP and several on my own site, and cannot find ANY with __EVENTTARGET in them. I think you're barking up the wrong tree there.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
Okay Christian. Thanks! Mark