Posts Tagged ‘ASP.NET’

Redirecting to an ASP.NET Mobile Web Page

(from: http://msdn2.microsoft.com/en-us/library/fhhycabe.aspx) If you create an application that has one user interface optimized for a desktop browser and a second user interface optimized for mobile applications, you need a mechanism to redirect mobile device customers to the mobile Web pages. Because some devices do not support cookies, consider whether you want to rely on cookies [...]

Leave a Comment

JavaScript和ASP.NET的传值 (转贴)

作者:陈缘 因项目需要,最近一段时间里对于js的开发有了一定的了解。在基于ASP.NET的开发中,经常性的需要JS脚本来增加一些客户端的控制,比如限制输入字 符,日期控件等等。一般这样的控制基本上在客户端完成就比较好,无需回传到服务端。总结了最近的开发中使用的一些js的技巧,提供给大家. 1、js脚本如何访问服务器控件的值 界面上有一个TextBox控件,ID为Name,js里可以采用如下脚本取Name的值 var myvalue=document.all(‘Name’).value; 2、服务器控件如何取js中变量的值 目前未发现比较好的办法,我通常采用的方法是在界面上放一个隐藏的控件HtmlInputHidden,然后设置为以服务器控件运行,这样在js脚本中和ASP.NET代码里都可以访问到该控件的值 js中给服务器控件赋值: var bt=document.all(‘Name’).value; bt.value=’名称’; ASP.NET中使用Name.Value来访问。 3、如何遍历界面上所有TextBox元素 var inputList = document.body.getElementsByTagName(“INPUT”); for(var i=0;i<inputList.length;i++) { if(inputList[i].disabled==false && (inputList[i].type==’text’ || inputList[i].type==’password’)) { inputList[i].value=””; } } 4、让dropdownlist选择到指定项 选择dropdownlist中值为“我得选择”得项 var handl=document.all(‘List1′); var myvalue=’我得选择’; for(var index=0;index<handle.options.length;index++) { if(handle.options[index].text==my_value) { handle.selectedIndex=index; } } From : http://tb.blog.csdn.net/TrackBack.aspx?PostId=473627

Leave a Comment

Let .NET Mobile Web Application support Javascripts

Is JavaScript supported in Mobile web application ? If yes, How ? Just give some samples: in web.config < system.web> < deviceFilters> < filter name=”supportsJavaScript” compare=”Javascript” argument=”true”/> </ deviceFilters> </system.web> in aspx <mobile:Form ID=”Form1″ Runat=”server”> <mobile:TextBox ID=”TextBox1″ Runat=”server”> </mobile:TextBox> <mobile:Command ID=”Command1″ Runat=”server” OnClick=”Command1_Click”>Command</mobile:Command> <mobile:Panel ID=”Panel1″ Runat=”server”> <mobile:DeviceSpecific ID=”DeviceSpecific1″ Runat=”server”> <Choice Filter=”supportsJavaScript” Xmlns=”http://schemas.microsoft.com/mobile/html32template”> <ContentTemplate> <script language=”javascript”> [...]

Leave a Comment

URLs in master page of asp.net 2.0

(from : http://www.odetocode.com/Articles/450.aspx ) At runtime, the master page and the content page are in the same control hierarchy – the master page is essentially a user control inside the content page. At design time, however, the master page and content page are two different entities. In fact, the master page and content page may [...]

Leave a Comment

How to display/hidden menu items automatically due to logined user in ASP.NET 2.0

How to display/hidden menu items automatically due to logined user in ASP.NET 2.0 .NET 2.0 has the feature of displaying/hidden menu items automatically due to logined user in ASP.NET 2.0, but you have to know how to set up. Normally, when you create a new .NET project, you can not get this feature, you will [...]

Leave a Comment

How to develop and debug ASP.NET custom controls in Visual Web Developer Express

(This all article is completely copy from “Mikhail Arkhipov (MSFT)’s WebLog” , I have not tried yet.  Thanks him! ) How to develop and debug ASP.NET custom controls in Visual Web Developer Express As you may know, Visual Web Developer Express only supports Web site projects and you can only have  a single project open [...]

Leave a Comment

Let ASP.NET 2.0 create “ASPNETDB.mdf” in my own database

The ASP.NET version 2.0 membership feature provides secure credential storage for application users. It also provides a membership API that simplifies the task of validating user credentials when used with forms authentication.(MS) when we create users and roles by selecting menu “ASP.NET Configration” wizard,  it will create a sql server express file named “aspnet.mdf”, but [...]

Leave a Comment

How to update MS.NET Classifieds Starter kit Template in VS2005?

I installed Classifieds Starter Kit Beta Version before. Today I just found there was a Final version come out. I downloaded the new one and double clicked the .vsi file and installed. But later I found there are two Classifieds Starter Kit templates and their names are the same in my VS 2005. So, how [...]

Leave a Comment