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 7859333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:52:44+00:00 2026-06-02T21:52:44+00:00

Facing difficulties: i’m looking for popup window for chat application in asp.net-c# protected void

  • 0

Facing difficulties:
i’m looking for popup window for chat application in asp.net-c#

   protected void Page_Load(object sender, EventArgs e)
     {
         System.Text.StringBuilder sb = new System.Text.StringBuilder(); 
         sb.Append("<script language='javascript'>function Open() {"); 
         sb.Append(string.Format("window.open('Chat.aspx?rid={0}'",lstRooms.SelectedValue));
         sb.Append(, 'newwindow','toolbar=no,location=no,menubar=no,width=290,height=330,resizable=no,scrollbars=no,top=350,left=980,right=500'");return false;"); 
         sb.Append("}</script>"); 

here is

    if (!ClientScript.IsClientScriptBlockRegistered("JSScriptBlock")) 
    {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "JSScriptBlock", sb.ToString()); 
    }

    if (!ClientScript.IsClientScriptBlockRegistered("JSScriptBlock")) 
    {
            ClientScript.RegisterClientScriptBlock(this.GetType(), "JSScriptBlock", sb.ToString()); 
    }

i got error…too many characters in character literal…in this line

sb.Append(, 'newwindow','toolbar=no,location=no,menubar=no,width=290,height=330,resizable=no,scrollbars=no,top=350,left=980,right=500'");return false;"); 

thnks for guidence

i updated my question as above….plz help me

  • 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-06-02T21:52:46+00:00Added an answer on June 2, 2026 at 9:52 pm

    Here you can find a very easy and nice tutorial for popup with asp.net and ajax:

    http://www.asp.net/web-forms/tutorials/ajax-control-toolkit/modalpopup/launching-a-modal-popup-window-from-server-code-cs

    Hope it helps you.

    Greetings

    UPDATE:

    this code is tested and works fine:

    HTML:

    <asp:Button ID="Button1" runat="server" OnClientClick="JavaScript:Open()" Text="Button" />
    

    C#

     protected void Page_Load(object sender, EventArgs e)
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("<script language='javascript'>function Open() {");
                sb.Append(string.Format("window.open('Chat.aspx?rid={0}'", lstRooms.selectedvalue));
                sb.Append(", 'newwindow','toolbar=no,location=no,menubar=no,width=290,height=330,resizable=no,scrollbars=no,top=350,left=980,right=500');return false;");
                sb.Append("}</script>");
    
                if (!ClientScript.IsClientScriptBlockRegistered("JSScriptBlock"))
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "JSScriptBlock", sb.ToString());
                }
            }
    

    Of course you have to add the OnClick Attribute to your html button and point to the Open() Method.

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

Sidebar

Related Questions

I´m facing a huge problem since a couple weeks. I´ve an asp.net application hosted
I'm playing with Remote Actors but I'm facing some difficulties. Consider this server: object
Our company is facing some difficulties with our CMS web application. This application was
Is there any way to force my asp.net application to load the assembly from
I'm facing a bit of difficulties implementing the HA for my ActiveMQ service. Right
When facing the problem of validating a property in a JSF2 application there are
Am facing a problem, while creating components through TOM API using .NET/COM Interop. Actual
I am facing difficulties to make my own Eclipse Intro Page ( as shown
I am facing some difficulties while assigning the values in an array list. My
I am facing some difficulties in getting my progress bar to retrieve its progress

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.