在开发手机页面,使用SelectionList,写明了text和value(字符),但是在查看代码的时候value总是从0开始的数字,这是什么原因啊?请教请教,谢谢

解决方案 »

  1.   

    .aspx:<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile"%>
    <%@ Page language="c#" Codebehind="AddBlog.aspx.cs" Inherits="Mwxw.wwwroot.Manager.AddBlog" AutoEventWireup="false" %>
    <HEAD>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" content="C#">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/Mobile/Page">
    </HEAD>
    <body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
    <mobile:Form id="Form1" runat="server">
    <mobile:Label id="Label1" runat="server">ADD BLOG</mobile:Label>
    <mobile:Label id="Label3" runat="server">日志分类</mobile:Label>
    <mobile:SelectionList id="SelectionList_ClassList" runat="server"></mobile:SelectionList>
    <mobile:Label id="Label2" runat="server">标题</mobile:Label>
    <mobile:TextBox id="TextBox_Title" runat="server"></mobile:TextBox>
    <mobile:SelectionList id="SelectionList_Public" runat="server">
    <Item Value="1" Text="公开日志"></Item>
    <Item Value="0" Text="隐藏日志"></Item>
    </mobile:SelectionList>
    <mobile:SelectionList id="SelectionList_Weather" runat="server">
    <Item Value="sunny" Text="晴天"></Item>
    <Item Value="cloudy" Text="多云"></Item>
    <Item Value="flurries" Text="疾风"></Item>
    <Item Value="ice" Text="冰雹"></Item>
    <Item Value="ptcl" Text="阴天"></Item>
    <Item Value="rain" Text="下雨"></Item>
    <Item Value="showers" Text="阵雨"></Item>
    <Item Value="snow" Text="下雪"></Item>
    </mobile:SelectionList>
    <mobile:Label id="Label4" runat="server">来自</mobile:Label>
    <mobile:TextBox id="TextBox_From" runat="server">本站原创</mobile:TextBox>
    <mobile:Label id="Label5" runat="server">Tags</mobile:Label>
    <mobile:TextBox id="TextBox_Tags" runat="server"></mobile:TextBox>
    <mobile:Label id="Label6" runat="server">内容</mobile:Label>
    <mobile:TextBox id="TextBox_Content" runat="server"></mobile:TextBox>
    <mobile:Label id="Label7" runat="server">作者</mobile:Label>
    <mobile:TextBox id="TextBox_Author" runat="server">maoch</mobile:TextBox>
    <mobile:Command id="Command_Submit" runat="server">提交</mobile:Command>
    </mobile:Form>
    </body>比如 天气那一项,已经写出了 value,但是在浏览页面时的代码是:<select name="SelectionList_Weather"><option value="0">晴天
    <option value="1">多云
    <option value="2">疾风
    <option value="3">冰雹
    <option value="4">阴天
    <option value="5">下雨
    <option value="6">阵雨
    <option value="7">下雪
    </select>请教