469,951 Members | 2,703 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

Problem with ASP:Button

I have a set of code that updates to a div tag through javascript
whenever a checkbox is checked, however I need a way to get that
information to the server side when the user uses the submit button.
So I created an asp:button on the page, but for some reason, everytime
I press the submit button, the page tries to reload and I get an error
page, not an error from the program itself, just a normal error page
for explorer.

I've noticed that when I create the event handler it will create the
method submit_click but inside the initialize component of the web
generated code, it doesn't initialize the handler. How can I fix this
so I can read in from the div tag when they press the button?

Thanks,

Dan

Oct 11 '06 #1
2 1163
hi

post some code, both the declaration in the aspx page as the code behind
--
Ignacio Machin
machin AT laceupsolutions.com

"DFDavis" <df*********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>I have a set of code that updates to a div tag through javascript
whenever a checkbox is checked, however I need a way to get that
information to the server side when the user uses the submit button.
So I created an asp:button on the page, but for some reason, everytime
I press the submit button, the page tries to reload and I get an error
page, not an error from the program itself, just a normal error page
for explorer.

I've noticed that when I create the event handler it will create the
method submit_click but inside the initialize component of the web
generated code, it doesn't initialize the handler. How can I fix this
so I can read in from the div tag when they press the button?

Thanks,

Dan

Oct 12 '06 #2
This is from the aspx declaration:

<asp:Button ID="Button1" runat="server"
Text="Submit" />

And here is the handler and init code from the code behind:

private void InitializeComponent()
{
this.btn_logout.Click += new
System.Web.UI.ImageClickEventHandler(this.btn_logo ut_Click);
this.Button1.Click += new EventHandler(Button1_Click);
this.TextBox1.TextChanged += new
EventHandler(TextBox1_TextChanged);
}

protected void Button1_Click(object sender, EventArgs e)
{
throw new Exception("The method or operation is not
implemented.");
}

Still haven't figured out how to get it to work for me so any help
would be appreciated.

Thanks,

Dan

Ignacio Machin ( .NET/ C# MVP ) wrote:
hi

post some code, both the declaration in the aspx page as the code behind
--
Ignacio Machin
machin AT laceupsolutions.com

"DFDavis" <df*********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
I have a set of code that updates to a div tag through javascript
whenever a checkbox is checked, however I need a way to get that
information to the server side when the user uses the submit button.
So I created an asp:button on the page, but for some reason, everytime
I press the submit button, the page tries to reload and I get an error
page, not an error from the program itself, just a normal error page
for explorer.

I've noticed that when I create the event handler it will create the
method submit_click but inside the initialize component of the web
generated code, it doesn't initialize the handler. How can I fix this
so I can read in from the div tag when they press the button?

Thanks,

Dan
Oct 12 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Maziar Aflatoun | last post: by
1 post views Thread by RUIZCJ | last post: by
7 posts views Thread by Lam | last post: by
3 posts views Thread by JV | last post: by
3 posts views Thread by Randall Parker | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.