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

  • Home
  • SEARCH
  • 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 8369161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:34:41+00:00 2026-06-09T13:34:41+00:00

I use 2 WebForms ans I want use one webform and from this I

  • 0

I use 2 WebForms ans I want use one webform and from this I want open a Dialog with the second Webform.
I want open the Dialog if I click on a LinkButton from the ListView and it works fine but I need values for the second Webform and so I first open the Dialog. This Dialog is empty. After I close this Dialog the Values send to a Session.

ASPX:

...
<script type="text/javascript">

         function OpenChild() {

             var WinSettings = "center:yes;resizable:no;dialogHeight:550px"
             var MyArgs = window.showModalDialog("Benutzer.aspx", MyArgs, WinSettings);

         }

    </script>
...
<asp:ListView runat="server" ID="myListView">

        <LayoutTemplate>
            <table id="UserTable" runat="server" border="0" width="800" cellpadding="0" cellspacing="0">
                <tr style="background-color:#E5E5FE" class="TableClass">
                    <th id="th1" runat="server"><asp:LinkButton ID="lnkBenutzer" runat="server" >id_Benutzer</asp:LinkButton></th>
                    <th id="th2" runat="server"><asp:LinkButton ID="lnkemail" runat="server" >id_Email</asp:LinkButton></th>
                    <th id="th3" runat="server"><asp:LinkButton ID="lnkVorname" runat="server" >id_Vorname</asp:LinkButton></th>
                    <th id="th4" runat="server"><asp:LinkButton ID="lnkNachname" runat="server" >id_Nachname</asp:LinkButton></th>
                    <th id="th5" runat="server"><asp:LinkButton ID="lnkTelefon" runat="server" >id_Telefon</asp:LinkButton></th>
                </tr>
                <tr runat="server" id="ItemPlaceholder">
                </tr>
            </table>
        </LayoutTemplate>

        <ItemTemplate>

            <tr class="TableClass">    
                <td align="left" ><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server" OnClientClick="OpenChild()" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" OnClientClick="OpenChild()" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" OnClientClick="OpenChild()" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" OnClientClick="OpenChild()" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" OnClientClick="OpenChild()" /></td>

              <td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>

            </tr>

        </ItemTemplate>

        <AlternatingItemTemplate>

            <tr class="TableClass"> 

                <td align="left" ><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label1" Text='<%# Eval("Benutzername") %>' runat="server" OnClientClick="OpenChild()" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label2" Text='<%# Eval("eMail") %>' runat="server" OnClientClick="OpenChild()" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label3" Text='<%# Eval("Vorname") %>' runat="server" OnClientClick="OpenChild()" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label4" Text='<%# Eval("Nachname") %>' runat="server" OnClientClick="OpenChild()" /></td>
                <td align="left"><asp:LinkButton CssClass="MyLink" OnCommand="Button1_Command" CommandName="Select" CommandArgument='<%# Container.DataItemIndex %>' ID="Label5" Text='<%# Eval("Telefonnummer") %>' runat="server" OnClientClick="OpenChild()" /></td>

                <td align="left"><asp:Label ID="Label6" Text='<%# Eval("GUID") %>' runat="server" Visible="False" /></td>

            </tr>

        </AlternatingItemTemplate>

        </asp:ListView>

C# Code:

…

protected void Button1_Command(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                //Der Index der Zeile wird ermitellt
                int index = Convert.ToInt32(e.CommandArgument);

                //Der Inhalt (GUID[Unsichtbar]) wird aus der zeile mit dem Index herausgezogen und übergeben
                Label lb = (Label)myListView.Items[index].FindControl("Label6");

                //Der GUID, Benutzer-Nachname und das Werk werden an eine Session übergeben
                Session["UserID"] = lb.Text;
                Session["SearchUser"] = txtBenutzer.Text;
                Session["DropDownValue"] = dropWerk.SelectedValue;


                //Es wird eine neue Webform geöffnet
                Response.Redirect("Benutzer.aspx",true);

            }

        }

…

I want that i save my Values in a Session and than open the dialog

tarasov

  • 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-09T13:34:42+00:00Added an answer on June 9, 2026 at 1:34 pm

    Javascript Code is always called first before server side code..you have to think about alternate way…You can use the ItemCommand Property of List View to set the Session Value and then call the Javascript function from Codebehind to open the Popup.

    protected void ListView_OnItemCommand(object sender, ListViewCommandEventArgs e)
      {
        if (String.Equals(e.CommandName, "OpenPopup"))
        {
    
          ListViewDataItem dataItem = (ListViewDataItem)e.Item;
          Session["UserID"]=((Label)dataItem.FindControl("Label6")).Text;
          Session["SearchUser"] = txtBenutzer.Text;                     
          Session["DropDownValue"] = dropWerk.SelectedValue;
          Page.ClientScript.RegisterStartupScript(GetType(), "Key", "OpenPopupFunction();", true); 
    
        }     
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use Ninject in a project which combines ASP.Net webforms and ASP.Net
I want to use the Drupal modules Webform and Email Marketing Framework to allow
I have a reportviewer (Microsoft.ReportViewer.WebForms) control on my page. All my reports use one
I upgraded my site to use ASP.Net MVC from traditional ASP.Net webforms. I'm using
I have an ASP.NET 4 WebForms-based application, and I want to use routing to
I use webforms/masterpage, with .NET. I Have many Web User Controls into my page.
I have a webforms page that makes quite extensive use of AJAX. There are
I'm try to use ASP.NET 4.0 WebForms Routing. Here is my RegisterRoutes function: void
I am trying to cut over an existing WebForms app to use Routing, and
I'm using .NET webforms. I have a grid view that can use Eval(Name) in

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.