asp.net ÖÐ EvalµÄʹÓÃ
<asp:TemplateField HeaderText="²âÊÔ">
<ItemTemplate>
<asp:LinkButton ID="test" runat="server" OnClick="test_Click" OnClientClick='<%# string.Format("return confirmDelete(\"{0} {1}\");", DoEscape((string)Eval("FirstName")), DoEscape((string)Eval("LastName")) ) %>'>²âÊÔ</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
Ïà¹ØÎĵµ£º
//ÒÔÏ´úÂë¸ù¾Ý±ðÈËÎÄÕºÍ×Ô¼ºÕûÀí
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace WebApplication1
{
public partial class DownfFile : System.Web.UI.Page
{
p ......
1.5.2 ÔÚIISÉÏÅäÖÃASP.NET
ÔÚ·þÎñÆ÷Éϲ¿ÊðASP.NETÍøվʱ£¬ÐèÒª.NETµÄÔËÐл·¾³.NET Framework¡£.NET FrameworkÀàËÆÓÚJavaµÄJDK£¬°üº¬ÓÐ.NET³ÌÐòÔËÐл·¾³ºÍÃüÁîÐбàÒ빤¾ß¡£Èç¹û·þÎñÆ÷ÉÏûÓа²×°.NET Framework£¬Õâ¾ÍÐèÒª´Ó΢ÈíÍøÕ¾ÏÂÔØ£¬ÏÂÔØÍøÖ·ÊÇ£º
http://msdn2.microsoft.com/zh-cn/default.aspx
»¹ÐèҪעÒâµÄÊÇ£¬Èç¹ ......
ÎÊÌâ1£º
“/dsfsd”Ó¦ÓóÌÐòÖеķþÎñÆ÷´íÎó¡£
佫¶ÔÏóÒýÓÃÉèÖõ½¶ÔÏóµÄʵÀý¡£
˵Ã÷: Ö´Ðе±Ç° Web ÇëÇóÆڼ䣬³öÏÖδ´¦ÀíµÄÒì³£¡£Çë¼ì²é¶ÑÕ»¸ú×ÙÐÅÏ¢£¬ÒÔÁ˽âÓйظôíÎóÒÔ¼°´úÂëÖе¼Ö´íÎóµÄ³ö´¦µÄÏêϸÐÅÏ¢¡£
Òì³£ÏêϸÐÅÏ¢: System.NullReferenceException: 佫¶ÔÏóÒýÓÃÉèÖõ½¶ÔÏóµÄʵÀý¡£
Ô´´íÎó:
Ö´ ......
Js´úÂë
var url=Service.aspx?Value=' + escape(va);
obj=CreateAJAX();
if(obj)
& ......
Asp.net ºǫ́µ÷ÓÃjs·½·¨(ת)
1. ÓÃResponse.Write·½·¨
¡¡¡¡´úÂëÈçÏ£º
Response.Write("<script type='text/javascript'>alert("XXX");</script>");
´Ë·½·¨È±ÏݾÍÊDz»Äܵ÷Óýű¾ÎļþÖеÄ×Ô¶¨ÒåµÄº¯Êý£¬Ö»Äܵ÷ÓÃÄÚ²¿º¯Êý£¬¾ßÌåµ÷ÓÃ×Ô¶¨ÒåµÄº¯ÊýÖ»ÄÜÔÚResponse.WriteдÉϺ¯Êý¶¨ Ò壬±ÈÈç
Response.Write("& ......