PDA

View Full Version : ایجاد url مجازی



matin63
سه شنبه 14 اسفند 1386, 12:19 عصر
من میخواهم وقتی کاربری در سایتم ثبت نام کرد و با اسم کاربری مثلا ali
آدرس صفحه آن مثلا site/ali.aspx را وارد کرد به صفحه site/user/user1.aspx ?name=ali
وارد شود برای همین از کد های زیر در فایل global استفاده کردم ولی هیچ کدام از عکسها رو نشون نمیده و با کدهایجاوا اسکریپت هم مشکل پیدا کرده .
Sub Application_BeginRequest()
Dim strUsername
Dim strCustomPath AsString
Dim strCurrentPath AsString
strCurrentPath = Request.Path.ToLower()
If strCurrentPath.IndexOf("/admin/") = -1 _
And strCurrentPath.IndexOf("/user/") = -1 _
And strCurrentPath.IndexOf("/users/") = -1 _
And strCurrentPath.IndexOf("about.aspx") = -1 _
And strCurrentPath.IndexOf("ads.aspx") = -1 _
And strCurrentPath.IndexOf("archive-prelist.aspx") = -1 _
And strCurrentPath.IndexOf("cafepress-archive.aspx") = -1 _
And strCurrentPath.IndexOf("cafepress-archive.aspx") = -1 _
And strCurrentPath.IndexOf("cafepress.aspx") = -1 _
And strCurrentPath.IndexOf("contact.aspx") = -1 _
And strCurrentPath.IndexOf("editorial-archive.aspx") = -1 _
And strCurrentPath.IndexOf("editorial.aspx") = -1 _
And strCurrentPath.IndexOf("index.aspx") = -1 _
And strCurrentPath.IndexOf("login-user.aspx") = -1 _
And strCurrentPath.IndexOf("loginadmin.aspx") = -1 _
And strCurrentPath.IndexOf("loginuser.aspx") = -1 _
And strCurrentPath.IndexOf("prelist.aspx") = -1 _
And strCurrentPath.IndexOf("pressanalyze-archive.aspx") = -1 _
And strCurrentPath.IndexOf("pressanalyze.aspx") = -1 _
And strCurrentPath.IndexOf("pressnews-archive.aspx") = -1 _
And strCurrentPath.IndexOf("print.aspx") = -1 _
And strCurrentPath.IndexOf("register.aspx") = -1 _
And strCurrentPath.IndexOf("rss.aspx") = -1 _
And strCurrentPath.IndexOf("search.aspx") = -1 _
And strCurrentPath.IndexOf("user.aspx") = -1 _
And strCurrentPath.IndexOf("pressnews.aspx") = -1 _
And InStr(strCurrentPath, "user1") = 0 Then
strUsername = strCurrentPath.Replace(".aspx", "")

strUsername = strUsername.Remove(0, InStrRev(strUsername, "/"))
If Request.ApplicationPath = "/"Then
strCustomPath = String.Format("/user1/user.aspx?url1={0}", strUsername)
Else
strCustomPath = String.Format("{0}/user1/user.aspx?url1={1}", Request.ApplicationPath, strUsername)
EndIf
Context.RewritePath(strCustomPath)

EndIf
EndSub


خواهشمندم من را راهنمایی بفرمایید.:چشمک: