Click here to Skip to main content
15,911,531 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Request.Form in MVC Pin
Quake2Player6-Oct-09 13:12
Quake2Player6-Oct-09 13:12 
GeneralRe: Request.Form in MVC Pin
Christian Graus6-Oct-09 13:19
protectorChristian Graus6-Oct-09 13:19 
GeneralRe: Request.Form in MVC Pin
ToddHileHoffer6-Oct-09 15:54
ToddHileHoffer6-Oct-09 15:54 
GeneralRe: Request.Form in MVC Pin
Quake2Player6-Oct-09 19:04
Quake2Player6-Oct-09 19:04 
GeneralRe: Request.Form in MVC Pin
Not Active6-Oct-09 16:20
mentorNot Active6-Oct-09 16:20 
GeneralRe: Request.Form in MVC Pin
Christian Graus6-Oct-09 16:42
protectorChristian Graus6-Oct-09 16:42 
GeneralRe: Request.Form in MVC Pin
N a v a n e e t h6-Oct-09 17:45
N a v a n e e t h6-Oct-09 17:45 
Questionrun javascript after postback Pin
samjesse6-Oct-09 10:28
samjesse6-Oct-09 10:28 
Hi
I am building an asp.net web application using visual studio 2008 with .NET 3.5 on Windows XP 32 bit machine where I have the server as well. C# and javascript are used.

There is contactUs.aspx, once the form is submitted successfully, I want to run the jQuery in the contactUs.js file starting from line 20 (var dataString = 'name=' + name + '&email=' + email;) to line 40 (return false;).

How do I wire it up.

contactUs.aspx.cs
<pre>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class contactUs : System.Web.UI.Page
{
      protected void Page_Load(object sender, EventArgs e)
      {

      }
      protected void Button1_Click(object sender, EventArgs e)
      {
            try
            {
                  totalCareAutoTableAdapters.ContactUsTableAdapter ContactUsAdapter = new totalCareAutoTableAdapters.ContactUsTableAdapter();
                  int new_ContactUs = Convert.ToInt32(ContactUsAdapter.InsertContactUs(name.Text, mobileNumber.Text, emailAddr.Text, subjectTitle.Text, messege.Text));
                 
            }
            catch (Exception ex)
            {

            }
      }
}
</pre>

contactUs.js
<pre>
/// &lt;reference path="jquery-1.3.2-vsdoc2.js" /&gt;

$(function()
{
      $('.error').hide();
      $(".button").click(function()
      {
            // validate and process form here

            $('.error').hide();
            var name = $("[id$='name']").val();
            var email = $("[id$='emailAddr']").val();
            if (name == "")
            {
                  $("[id$='name_error']").show();
                  $("[id$='name']").focus();
                  return false;
            }

            var dataString = 'name=' + name + '&amp;email=' + email;

            $.ajax({
                  type: "POST",
                  url: "siteMap.aspx",
                  data: dataString,

                  success: function()
                  {

                        $("[id$='contact_form']").html("&lt;div id='message'&gt;&lt;/div&gt;");
                        $("[id$='message']").html("&lt;h2&gt;Contact Form Submitted!&lt;/h2&gt;")
                        .append("&lt;p&gt;We will be in touch soon.&lt;/p&gt;")
                        .hide()
                        .fadeIn(1500, function()
                        {
                              $("[id$='message']").append("&lt;img id='checkmark' src='images/fiat.jpeg' /&gt;");
                        });
                  }
            });
            return false;

      });
});

</pre>
AnswerRe: run javascript after postback Pin
Christian Graus6-Oct-09 10:45
protectorChristian Graus6-Oct-09 10:45 
QuestionNeed help with loading rows of input controls one at a time Pin
Michael Eber6-Oct-09 7:13
Michael Eber6-Oct-09 7:13 
AnswerRe: Need help with loading rows of input controls one at a time Pin
Not Active6-Oct-09 7:55
mentorNot Active6-Oct-09 7:55 
GeneralRe: Need help with loading rows of input controls one at a time Pin
Michael Eber7-Oct-09 13:20
Michael Eber7-Oct-09 13:20 
GeneralRe: Need help with loading rows of input controls one at a time Pin
Not Active7-Oct-09 14:14
mentorNot Active7-Oct-09 14:14 
GeneralRe: Need help with loading rows of input controls one at a time Pin
Michael Eber8-Oct-09 6:10
Michael Eber8-Oct-09 6:10 
GeneralRe: Need help with loading rows of input controls one at a time Pin
Michael Eber8-Oct-09 6:16
Michael Eber8-Oct-09 6:16 
GeneralRe: Need help with loading rows of input controls one at a time Pin
Not Active8-Oct-09 6:34
mentorNot Active8-Oct-09 6:34 
GeneralRe: Need help with loading rows of input controls one at a time Pin
Michael Eber8-Oct-09 6:50
Michael Eber8-Oct-09 6:50 
GeneralRe: Need help with loading rows of input controls one at a time Pin
Not Active8-Oct-09 8:46
mentorNot Active8-Oct-09 8:46 
GeneralRe: Need help with loading rows of input controls one at a time Pin
Michael Eber8-Oct-09 8:48
Michael Eber8-Oct-09 8:48 
QuestionFailed to stop window service through application in Windows server 2003 Pin
ramkris846-Oct-09 5:20
ramkris846-Oct-09 5:20 
AnswerRe: Failed to stop window service through application in Windows server 2003 Pin
Christian Graus6-Oct-09 10:46
protectorChristian Graus6-Oct-09 10:46 
GeneralRe: Failed to stop window service through application in Windows server 2003 Pin
ramkris846-Oct-09 20:51
ramkris846-Oct-09 20:51 
GeneralRe: Failed to stop window service through application in Windows server 2003 [modified] Pin
ramkris847-Oct-09 18:44
ramkris847-Oct-09 18:44 
Questionhow to send sms from web to mobile Pin
M.Hussain.6-Oct-09 3:56
M.Hussain.6-Oct-09 3:56 
AnswerRe: how to send sms from web to mobile Pin
Richard MacCutchan6-Oct-09 4:29
mveRichard MacCutchan6-Oct-09 4:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.