Advertisement

05.15.2008 at 10:08PM PDT, ID: 23407429
[x]
Attachment Details

How do I get __doPostBack if it's not on the page?

Asked by bemara57 in .NET Framework 2.0, C# Programming Language, Programming for ASP.NET

I have a very simple contact form page that doesn't even have any controls on it. It has input text boxes that I would like to handle in my code-behind. I'm trying to invoke __doPostBack on my input button that looks like this:

<input type="text" name="email" value="" /> ...
<input type="image" src="images/submit.gif" alt="Submit" onclick="javascript:__doPostBack('sendemail', 'name,company,email,phone,category,budget,message,urgent');" />

The problem is that when I look at the HTML source code, __doPostBack isn't even on there- so submitting my form gives a Javascript error of "Object Expected". I don't want to put any .NET controls on the page because most of the page is administrated by an html editor, which obviously can't understand or create .NET controls. How do I register the __doPostBack function on there? I plan to do this from my BasePage that other pages use but don't know how.Start Free Trial
 
 
[+][-]05.15.2008 at 10:25PM PDT, ID: 21580212

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET Framework 2.0, C# Programming Language, Programming for ASP.NET
Sign Up Now!
Solution Provided By: pratima_mcs
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.16.2008 at 08:15AM PDT, ID: 21583464

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 08:25AM PDT, ID: 21583569

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628