for example , <appSettings>

<add key="DataGridCount" value="15"></add>here we can define a DataGridCount 's property , so in your App, you can read it and handle it as a constant  ,  so  the datagrid can paginate every 15 lines

解决方案 »

  1.   

    在web.config中添加:
    <SourceViewer>
        <add key="modules" value="jhgjh" />
      </SourceViewer>
    应用:
    private void Button1_Click(object sender, System.EventArgs e)
    {
    Label1.Text=System.Configuration.ConfigurationSettings.AppSettings["connectionString"];

    NameValueCollection settings;         
    settings = (NameValueCollection) System.Configuration.ConfigurationSettings.GetConfig("SourceViewer");

    Object setting = settings["modules"];
    Label1.Text= (String)setting;
    }