返回首页

如何在阵列上添加文本框和查询字符串传递它的价值在第二页?
我的HTML代码如下

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TextBoxInLoop.aspx.cs" Inherits="TextBoxInLoop" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head  runat="server">

    <title></title>

</head>

<body>

    <form id="form1"  runat="server">

    <div>

    

     Employee ID  

        <asp:TextBox ID="txtId" runat="server"></asp:TextBox>

        <br />

        <br />

        Employee Name 

        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>

        <br />

        <br />

        Employee Email 

        <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>

        <br />

        <br />

        Contact Number 

        <asp:TextBox ID="txtCno" runat="server"></asp:TextBox>

        <br />

        <br />

 Address             

        <asp:TextBox ID="txtAdd" runat="server"></asp:TextBox>

        <br />

        <br />

        Qualification        

        <asp:TextBox ID="txtQua" runat="server" ontextchanged="TextBox6_TextChanged"></asp:TextBox>

        <br />

        <br />

        Company            

        <asp:TextBox ID="txtCo" runat="server"></asp:TextBox>

        <br />

        <br />

        Salary                 

        <asp:TextBox ID="txtSal" runat="server"></asp:TextBox>

    

    </div>

    </form>

</body>

</html>

回答

评论会员:游客 时间:2012/02/07
坦维尔答:单页暗淡STR为新)导航页NBSP暗淡作为新的ArrayListSTRSTR=高速缓存("测试")TextBox1.Text=str.item(0)|shobana16:试试这个,{C}在page1.aspx.cs(按钮的Click事件)codeprelang="c#"spanclass="code-keyword"protected/spanspanclass="code-keyword"void/spanpass_QS(spanclass="code-keyword"object/spansender,EventArgse){ArrayListmyAL1=spanclass="code-keyword"new/spanArrayList();myAL1.Add(TextBox1.Text.ToString());myAL1.Add(TextBox2.Text.ToString());spanclass="code-keyword"string/spanitems=spanclass="code-SDKkeyword"String/span.Join(spanclass="code-string""/spanspanclass="code-string","/span,((spanclass="code-keyword"string/span[])myAL1.ToArray(spanclass="code-keyword"typeof/span(spanclass="code-SDKkeyword"String/span))));spanclass="code-keyword"string/spanurl=spanclass="code-string""/spanspanclass="code-string"Default3.aspx?items="/span+items;Response.Redirect(url);}/pre/code在page2.aspx.cs{
坦维尔体C3}答:不要使用阵列
使用这个
通过值
{的C4}
retreive值
{C5的}
评论会员:SunasaraImdadhusen 时间:2012/02/07
您好,
如果你想通过使用查询字符串文本框的值到下一页试试这个

{5233}上面的代码将发送文本框的值下一页

你可以采取在NextPage.aspx价值

{C7-}
评论会员:游客 时间:2012/02/07
patil.ravi035:你这里有两个问题1)你的领域在QueryString的名称将更好地写没有@符号2)如果不存在指定的查询字符串参数,然后返回一个空字符串,Convert.ToInt32方法是无效的格式。为了解决这个问题,包装这样的querystring参数检索。{C8的}您的通话将东西看起来http://www.YourSite/YourPage.aspx?ID=100如果有人不小心使用像http://www.YourSite/YourPage.aspx?ID=100东西,那么上面的代码将仍然工作