Click here to Skip to main content
15,889,844 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Using ASP.Net, i'hv developed a master page with a form.
Now, i developed a content page with a form. On submit of content page form button i wana call a generic handler. How can i do this???? Wen a simply do this handler is not called.
I cant pass form action inn master page as this affecting other pages.
Wen i simply developed a page without dis master page den code workin fine.

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted
Updated 1-May-12 3:36am
v2
Comments
OriginalGriff 1-May-12 9:36am    
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
[no name] 1-May-12 10:55am    
Your question is not very clear. What form? What handler? What are you trying to accomplish?
Ganesan Senthilvel 8-May-12 13:03pm    
Clarity of question is too important to get answered.

1 solution

At first add a Generic handler in your project.

Generic handlers are the .NET components that implement the System.Web.IHttpHandler interface. Any class that implements the IHttpHandler interface can act as a target for the incoming HTTP requests. Page is also generic handler. In general generic handlers have an extension of ASHX.

Then, In the handler write a function in which you specify what do you want do on submit. like

//Example
private void CheckRequisitionNo()
{
String refSourceString = String.Empty;
String RN = HttpContext.Current.Request.QueryString["rn"];

//Write the code as per your requirements
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "text/plain";
HttpContext.Current.Response.Write(refSourceString);
HttpContext.Current.Response.Flush();
}

Then , call the function from client side.

Like:
DataHandler.ashx?CallMode=CheckRequisitionNo&ItemCode=' +
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900