Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 01, 2012 03:01 PM by madan535
Member
732 Points
449 Posts
Feb 27, 2012 04:38 PM|LINK
Hi,
is there a way to submit a form without reloading or refreshing the page?
All-Star
112247 Points
18271 Posts
Moderator
Feb 27, 2012 04:45 PM|LINK
126031 Points
10310 Posts
Feb 27, 2012 04:54 PM|LINK
If you are using jQuery, google the jQuery Form plugin.
22 Points
15 Posts
Feb 27, 2012 04:58 PM|LINK
hi dow
go through this link
http://be.twixt.us/jquery/formSubmission.php
Feb 27, 2012 08:46 PM|LINK
My code is this, can someone give me a simple solution without refreshing the page
@{ var db = Database.Open("money"); var lastRecord = db.QuerySingle("SELECT TOP 1 * FROM foreign ORDER BY ID DESC"); var Result = 0m; var LastValue = Request["UserInput"]; var LastPrice = Request["currency"]; if(IsPost) { var Price = decimal.Parse(lastRecord[Request["currency"]]); var UserInput = Request["UserInput"].AsDecimal(); if (UserInput == 0) { ModelState.AddError("UserInput", "Enter amount!"); } // calculate Result = UserInput * Price; } } <form action="" method="post"> <table> <tr> <td><select name="currency"> <option>Select</option> <option>USD</option> <option>EUR</option> <option>GBP</option> <option>CHF</option> <option>JPY</option> </select></td> </tr> <tr> <td><input type="text" name="UserInput" size="14" value="1"/> <input type="submit" value="Go"/></td> </tr> </table> </form> <text>@if(ModelState.IsValid) {<span>Result:</span> @LastValue<span> </span>@LastPrice @Result} else {@Html.ValidationSummary()}</text>
43705 Points
4304 Posts
Microsoft
Mar 01, 2012 08:10 AM|LINK
You could use Updatepanel or call web service on client side. For more details of updatepanel, please refer to: http://msdn.microsoft.com/en-us/library/bb386454.aspx. For Calling Web Services from Client Script, please refer to: http://msdn.microsoft.com/en-us/library/bb398995(v=VS.90).aspx.
Contributor
3217 Points
1179 Posts
Mar 01, 2012 03:01 PM|LINK
refer this
http://www.codeproject.com/Articles/17203/Using-jQuery-for-AJAX-in-ASP-NET
dow7
Member
732 Points
449 Posts
How to submit a form without reloading or refreshing the page?
Feb 27, 2012 04:38 PM|LINK
Hi,
is there a way to submit a form without reloading or refreshing the page?
MetalAsp.Net
All-Star
112247 Points
18271 Posts
Moderator
Re: How to submit a form without reloading or refreshing the page?
Feb 27, 2012 04:45 PM|LINK
SGWellens
All-Star
126031 Points
10310 Posts
Moderator
Re: How to submit a form without reloading or refreshing the page?
Feb 27, 2012 04:54 PM|LINK
If you are using jQuery, google the jQuery Form plugin.
My blog
awanishkumar...
Member
22 Points
15 Posts
Re: How to submit a form without reloading or refreshing the page?
Feb 27, 2012 04:58 PM|LINK
hi dow
go through this link
http://be.twixt.us/jquery/formSubmission.php
dow7
Member
732 Points
449 Posts
Re: How to submit a form without reloading or refreshing the page?
Feb 27, 2012 08:46 PM|LINK
My code is this, can someone give me a simple solution without refreshing the page
@{ var db = Database.Open("money"); var lastRecord = db.QuerySingle("SELECT TOP 1 * FROM foreign ORDER BY ID DESC"); var Result = 0m; var LastValue = Request["UserInput"]; var LastPrice = Request["currency"]; if(IsPost) { var Price = decimal.Parse(lastRecord[Request["currency"]]); var UserInput = Request["UserInput"].AsDecimal(); if (UserInput == 0) { ModelState.AddError("UserInput", "Enter amount!"); } // calculate Result = UserInput * Price; } } <form action="" method="post"> <table> <tr> <td><select name="currency"> <option>Select</option> <option>USD</option> <option>EUR</option> <option>GBP</option> <option>CHF</option> <option>JPY</option> </select></td> </tr> <tr> <td><input type="text" name="UserInput" size="14" value="1"/> <input type="submit" value="Go"/></td> </tr> </table> </form> <text>@if(ModelState.IsValid) {<span>Result:</span> @LastValue<span> </span>@LastPrice @Result} else {@Html.ValidationSummary()}</text>Song-Tian - ...
All-Star
43705 Points
4304 Posts
Microsoft
Re: How to submit a form without reloading or refreshing the page?
Mar 01, 2012 08:10 AM|LINK
Hi,
You could use Updatepanel or call web service on client side. For more details of updatepanel, please refer to: http://msdn.microsoft.com/en-us/library/bb386454.aspx. For Calling Web Services from Client Script, please refer to: http://msdn.microsoft.com/en-us/library/bb398995(v=VS.90).aspx.
Feedback to us
Develop and promote your apps in Windows Store
madan535
Contributor
3217 Points
1179 Posts
Re: How to submit a form without reloading or refreshing the page?
Mar 01, 2012 03:01 PM|LINK
refer this
http://www.codeproject.com/Articles/17203/Using-jQuery-for-AJAX-in-ASP-NET