Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7080031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:44:41+00:00 2026-05-28T06:44:41+00:00

This code displays a Jquery dialog with an html textbox that is shown after

  • 0

This code displays a Jquery dialog with an html textbox that is shown after the user clicks on an asp:button btnNewGroup

<script type="text/javascript" language="javascript">
function pageLoad(sender, args) {
    var $dialog = $('<div><fieldset><label for="name">Name</label><input type="text" name="Name" id="name" class="text ui-widget-content ui-corner-all" /></div>')
        .dialog({
            modal: true,
            autoOpen: false,
            title: 'Enter New Group Name',
            buttons: {
                'New': function () {
                    $(this).dialog('close');
                },
                Cancel: function () {
                    $(this).dialog('close');
                }
            }
        });


        $("#<%=btnNewGroup.ClientID %>").click(function () {
            $dialog.dialog('open');
            return true;
        });
}
</script>

<asp:Button ID="btnNewGroup" runat="server" Height="26px" 
onclick="btnNewGroup_Click" Style="margin-bottom: 0px" Text="New Group" 
ClientIDMode="Static" />

protected void btnNewGroup_Click(object sender, EventArgs e)
    {
        String t = Request.Form["Name"];
    }

When the user clicks the new button in the dialogue I want to take the name from the textbox and use it in my code behinds asp new button click event.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:44:42+00:00Added an answer on May 28, 2026 at 6:44 am

    I’m not really sure if this is what you are looking for but you coud pass the Name value to a Server side Web Method. by using Jquery’s Ajax with in the function for the New button.

    On the server side in your code behind page you create a Web Method by adding a

    using System.Web.Services;
    

    to the top of your page and then creating a web method in your code behind like this

    [WebMethod]
    public static void DoSomething(object name)
    {
       //do something intersting
    }
    

    The Ajax call would replace the

     $(this).dialog('close');
    

    That you currently have in your New Button click event with something like this.

    var valFromNameBox = $("#name").val();
    var jsonObj = '{name: "' + valFromNameBox + '"}';
    var res;
    $.ajax({
        type: 'POST',
        contentType: 'application/json; charset=utf-8',
        data: jsonObj,
        dataType: 'json',
        url: 'YourPage.aspx/DoSomething',
        success: function (result) {
        },
        error: function (err) {
            alert(err.toString());
        }
    });
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some jQuery code like this: // Called right away after someone clicks
I have an ASP.NET website which uses the jQuery dialog to present the user
On my web page I have a button that opens a modal jQuery dialog.
I have a jQuery dialog that posts a form when the Please Confirm button
I've got a jQuery dialog and an asp.net button (Delete). When the delete button
This code correctly fetches data, and displays it; however, the sort is completely ignroed.
I'm trying to understand this bit of code: in display.php: <html> ... <body> <table>
my code is something like this //css li{display:inline-block} //html #li margin and width are
I have a HTML table that displays rows of records and has a column
I have a fairly basic dialog maker for jquery that works in 2 out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.