C# webBrowser控件问题
1个回答
展开全部
我的完全可以,请黏贴如下代码看看呢?(我用Maxthon最新版本的):
以下是aspx代码:
<%@
Page
Language="C#"
AutoEventWireup="true"
CodeBehind="WebForm7.aspx.cs"
Inherits="TestWebDemo.WebForm7"
EnableViewState="false"
%>
<!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>ViewState
Demo</title>
</head>
<body>
<form
id="form1"
runat="server"
method=get>
<div>
<input
type=textbox
value='
<%=ConfigurationManager.AppSettings["constr"]%>'
style='width:734px'
/>
</div>
</form>
</body>
</html>
以下是配置文件:
<configuration>
<appSettings>
<add
key="constr"
value="server=server2;database=Test;uid=*****;pwd=*****"/>
</appSettings>
<connectionStrings>
<add
name="NorthwindConnectionString"
connectionString="Data
Source=.\sqlexpress;Initial
Catalog=Northwind;Integrated
Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
....
以下是aspx代码:
<%@
Page
Language="C#"
AutoEventWireup="true"
CodeBehind="WebForm7.aspx.cs"
Inherits="TestWebDemo.WebForm7"
EnableViewState="false"
%>
<!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>ViewState
Demo</title>
</head>
<body>
<form
id="form1"
runat="server"
method=get>
<div>
<input
type=textbox
value='
<%=ConfigurationManager.AppSettings["constr"]%>'
style='width:734px'
/>
</div>
</form>
</body>
</html>
以下是配置文件:
<configuration>
<appSettings>
<add
key="constr"
value="server=server2;database=Test;uid=*****;pwd=*****"/>
</appSettings>
<connectionStrings>
<add
name="NorthwindConnectionString"
connectionString="Data
Source=.\sqlexpress;Initial
Catalog=Northwind;Integrated
Security=True"
providerName="System.Data.SqlClient"/>
</connectionStrings>
....
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询