之前在IIS6要使用Rewrite的話可以透過其他模組的方法達成,
現在的IIS 7內部就提供模組來支援Rewrite的功能。
可參考以下這篇文章學習:
[系統管理]IIS7 的 Rewrite Model (SEO 網址靜態化)
[系統管理]IIS7 的 Rewrite Model (SEO 網址靜態化)
<div>
<asp:DataList ID="DataListTestPaper" runat="server" DataKeyField="TestPaperItemID" DataSourceID="SqlDataSourceTestPaper" OnItemDataBound="DataList1_ItemDataBound" Width="736px" CellPadding="4" ForeColor="#333333">
<ItemTemplate>
(<%# Container.ItemIndex + 1%>)
<!--試題id之後對答案要用到-->
<asp:Label ID="TestPaperItemIDLabel" runat="server" Text='<%# Eval("TestPaperItemID") %>' style="display: none;"></asp:Label>
<asp:Label ID="TestPaerContentLabel" runat="server" Text='<%# Eval("TestPaerContent") %>'></asp:Label>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" DataSourceID="SqlDataSourceOptions" DataTextField="TestPaperOptionsText" DataValueField="TestPaperOptionsID" RepeatDirection="Horizontal">
</asp:RadioButtonList>
<asp:SqlDataSource ID="SqlDataSourceOptions" runat="server" ConnectionString="<%$ ConnectionStrings:ELTestPaperConnectionString %>"
SelectCommand="SELECT TestPaperOptionsText, TestPaperOptionsID FROM TestPaperOptions WHERE (TestPaperOptionsPID = @pid) order by newid() ">
<SelectParameters>
<asp:ControlParameter ControlID="TestPaperItemIDLabel" Name="pid" PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
</ItemTemplate>
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<SelectedItemStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<AlternatingItemStyle BackColor="White" />
<ItemStyle BackColor="#E3EAEB" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
</asp:DataList><asp:SqlDataSource ID="SqlDataSourceTestPaper" runat="server" ConnectionString="<%$ ConnectionStrings:ELTestPaperConnectionString %>"
SelectCommand="SELECT * FROM [TestPaper] where TestPaperCategoryID = @cid order by newid() ">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="1" Name="cid" QueryStringField="cid" />
</SelectParameters>
</asp:SqlDataSource>
</div>
using(StreamReader sr = new StreamReader(ckipPath,Encoding.Default))
{
while ((termTemp = sr.ReadLine()) != null)
{
termTemp = termTemp.Substring(0,termTemp.IndexOf(" "));
}
}
////// base64convert 的摘要描述 /// public class base64convert { public base64convert() { } public string ConvertStringToBase64(string s) { byte[] ToByte = System.Text.Encoding.Default.GetBytes(s.ToString().Trim()); string str = Convert.ToBase64String(ToByte); return str; } public string ConvertBase64ToString(string s) { byte[] strbyte = Convert.FromBase64String(s.ToString().Trim()); string str = System.Text.Encoding.Default.GetString(strbyte); return str; } }