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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:21:26+00:00 2026-06-03T03:21:26+00:00

~/Admin/AdimHome.aspx.cs C# code protected void Page_Load(object sender, EventArgs e) { System.Text.StringBuilder sb = new

  • 0

~/Admin/AdimHome.aspx.cs C# code

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());
     }

    lblFacultyNo.Text = Session["User_Id"].ToString();
    lblUserType.Text = Session["User_Type"].ToString();

    pnlChat.Visible = false;   
}

~/Admin/Chat.aspx.cs page C# code

protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User_Id"] == null)
            Response.Redirect("~/Admin/AdimHome.aspx");
        if (string.IsNullOrEmpty(Request.QueryString["rid"]))
            Response.Redirect("~/Admin/AdminHome.aspx");

        txtMsg.Attributes.Add("onkeypress", "return clickButton(event,'btn')");

        if (!IsPostBack)
        {
            hdnRoomID.Value = Request.QueryString["rid"];
            ChatRoom room = ChatEngine.GetRoom(hdnRoomID.Value);
            string prevMsgs = room.JoinRoom(Session["User_Id"].ToString(), Session["User_Id"].ToString());
            txt.Text = prevMsgs;
            foreach (string s in room.GetRoomUsersNames())
            {
                lstMembers.Items.Add(new ListItem(s, s));
            }

        }
    }

want to pass lstRooms.SelectedValue to Chat.aspx.cs page to check as per client request to differentiate their chat rooms:

sb.Append(string.Format("window.open('Chat.aspx?rid={0}'", lstRooms.SelectedValue));

onclicking the btnChat event:

<asp:Button ID="btnChat" Runat="server" CssClass="btn" OnClientClick="JavaScript:Open()" OnClick="btnChat_Click" Text="Join Room" />
  • 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-03T03:21:27+00:00Added an answer on June 3, 2026 at 3:21 am

    The simple solution to your problem could be if you want to change your code…

    //Javascript function
    function Open()
    {
       var ddl = document.getElementbyId('<%= lstRooms.ClientID%>');
       var ddlvalue = ddl.options[ddl.selectedIndex].value;
       Window.Open("Chat.aspx?rid=" + ddlvalue );
    }
    

    remove all the code for JS in pageload and put this on aspx page.
    let me know if it solves

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

Sidebar

Related Questions

For example: @PreAuthorize(hasRole('admin') && hasPermission('save', #user)) void updateUser(User user) { // some code }
In admin I would like to disable a field when modifying object, but make
The Admin dropdown on a new plone 4 instance isn't providing the dropdown it
In my admin view I would like several sub directories for example: admin/users/list.aspx I
I'm the IIS admin, not the developer on this site, so the code is
I have three new admin users for my Mac: Math, CS and Fun. I
Admin Main controller: def new @admin = Admin.new @invitation = @admin.invitations.build @admi.user_admin_relationships.build end def
i generated doctrine-admin in backend. In frontend i have form for add new news.
#admin.py class GameListAdmin(admin.ModelAdmin): list_display = ['game', 'position'] ordering = ('position',) class GameAdmin(admin.ModelAdmin): list_display =
I have an admin view which contains four foreign keys each with a few

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.