Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÔÚasp.net webserviceÖÐÈçºÎʹÓÃsession

 
ÔÚʹÓÃasp.net±àдwebserviceʱ£¬Ä¬ÈÏÇé¿öÏÂÊDz»Ö§³ÖsessionµÄ£¬µ«ÎÒÃÇ¿ÉÒÔ°ÑWebMethodµÄEnableSessionÑ¡ÏîÉèΪtrueÀ´ÏÔʽµÄ´ò¿ªËü£¬Çë¿´ÒÔÏÂÀý×Ó£º
1 н¨ÍøÕ¾WebSite 
2 н¨web·þÎñWebService.asmx£¬Ëü¾ßÓÐÒÔÏÂÁ½¸ö·½·¨£º
 C#-Code:
[WebMethod(EnableSession = true)]
public string Login(string name)
{
    Context.Session["name"] = name;
    return name;
}  
[WebMethod(EnableSession = true)]
public string GetName()
{
    if (Context.Session["name"] != null)
        return Context.Session["name"].ToString();
    else
        return "";
}
3 Ìí¼Óasp.netÒ³ÃæSessionInWebservice.aspx
 ASP.NET-Code:
<form id="form1" runat="server">
    <div>
        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        <asp:Button ID="btnLogin" runat="server"
            Text="Login" OnClick="btnLogin_Click" />
    </div>
    <div>
        <asp:Button ID="btnGetName" runat="server"
            Text="GetName" OnClick="btnGetName_Click" />
        <asp:Label ID="lblName" runat="server" Text="Label"></asp:Label>
    </div>
</form>
SessionInWebservice.aspx.cs
 C#-Code:
protected void btnLogin_Click(object sender, EventArgs e)
{
    WebService ws = new WebService();   
    ws.Login(txtName.Text);
}
protected void btnGetName_Click(object sender, EventArgs e)
{
    WebService ws = new WebService();
    lblName.Text = ws.GetName();
}
ÎÊ


Ïà¹ØÎĵµ£º

ѧϰASP.NETÐèÇóµÄ»ù±¾µÄc#֪ʶ£¨×ªÌû+ÒÑÐ޸ģ©

£¨±¸×¢£ºÎÄÖкìÉ«×ÖÌåÊÇÎÒÔÚÔ­ÎĵĻù´¡ÉÏÌí¼ÓµÄ½âÊÍ˵Ã÷£©
 Î¢ÈíµÄʵÀý½Ì²ÄÖн²ÁËÈýÖÖÓïÑÔ£ºc#¡¢vb   ¡¢Jscript£¬ÎªÁËÈôó¼Ò¹ýÒ»°Ñж«Î÷ñ«£¬ÎÒÃÇ»¹ÊÇѧc#°É¡£Õâ¸ö×îºÃÓÐÒ»µãc++»ù´¡¡£    
  ²»¹ýûÓÐҲûÓйØϵ£¬´ó²»Á˶à·ÑµãÁ¦ÁË¡£    
  ÈκÎÒ»ÃÅÓ ......

ASP.NET AJAX ½Ìѧ±Ê¼Ç(Èý) 1

Ajax¿ª·¢ÈËÔ±ÐèÒªµÄJavaScript֪ʶ
  JavaScriptµ®ÉúÓÚ1995 Ä꣬×î×³ÉÔÚNetsCape Navigatorä¯ÀÀÆ÷ÖС£Microsoft ÔÚIE3Öм¯³É¡£1998Äê±»±ê×¼»¯ÎªECMAScript.
  Microsoft Ajax Library¸ÄÉÆÁËJavaScriptµÄÃæÏò¶ÔÏóÄ£ÐÍ¡£
3.1ʹÓöÔÏó
   JavaScriptÖеĶÔÏó²¢²»ÊÇÀàÐ͵ÄʵÀý£¬ÒòΪJavaScript²»Ö§³ ......

×îÈ«µÄASP.NET¿ªÔ´CMS»ã×Ü

¹úÄÚCMS£º
1.SiteServer CMS
SiteServer CMS ÍøÕ¾ÄÚÈݹÜÀíϵͳ£¨Öø×÷ȨµÇ¼ÇºÅ2008SR15710£©ÊǶ¨Î»ÓÚÖи߶ËÊг¡µÄCMSÄÚÈݹÜÀíϵͳ£¬Äܹ»ÒÔ×îµÍµÄ³É
±¾¡¢×îÉÙµÄÈËÁ¦Í¶ÈëÔÚ×î¶ÌµÄʱ¼äÄÚ¼ÜÉèÒ»¸ö¹¦ÄÜÆëÈ«¡¢ÐÔÄÜÓÅÒì¡¢¹æÄ£ÅÓ´óµÄÍøվƽ̨¡£
¡¡¡¡ SiteServer CMS ÊÇ»ùÓÚ΢Èí.NET ƽ̨¿ª·¢µÄÍøÕ¾ÄÚÈݹÜÀíϵͳ£¬Ëü¼¯³ÉÁËÄÚÈÝ·¢² ......

asp.net´úÂëÓÅ»¯

ASP.NET´úÂëÓÅ»¯Ò»¡¢Ò³ÃæºÍ·þÎñÆ÷¿Ø¼þ´¦Àí
1¡¢ASP.NET´úÂëÓÅ»¯±ÜÃâµ½·þÎñÆ÷µÄ²»±ØÒªµÄÍù·µÐгÌ
ÔÚijЩÇé¿öϲ»±ØʹÓà ASP.NET ·þÎñÆ÷¿Ø¼þºÍÖ´Ðлط¢Ê¼þ´¦Àí¡£ÀýÈ磬ÔÚ ASP.NET ÍøÒ³ÖÐÑéÖ¤Óû§ÊäÈë¾­³£¿ÉÔÚÊý¾ÝÌá½»µ½·þÎñÆ÷֮ǰÔÚ¿Í»§¶Ë½øÐС£Í¨³££¬Èç¹û²»ÐèÒª½«ÐÅÏ¢´«µÝµ½·þÎñÆ÷ÒÔ½øÐÐÑéÖ¤»ò½«ÆäдÈëÊý¾Ý´æ´¢Çø£¬Çë±ÜÃâÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ