|
The following are the test urls, i need to remove the "Admin" from the URL. So I want the regular expression to solve this issue
http://www.Admin.testsite.com/Administrator/Login.aspx
http://Admin.www.testsite.com/Administrator/Login.aspx
http://Admin.testsite.com/Administrator/Login.aspx
http://quality.Admin.testsite.com/Administrator/Login.aspx
Once we remove the "Admin" word or text from the above URL , output would be
http://www.testsite.com/Administrator/Login.aspx
http://www.testsite.com/Administrator/Login.aspx
http://testsite.com/Administrator/Login.aspx
http://quality.testsite.com/Administrator/Login.aspx
|
|
|
|
|
jayarajRaman wrote: So I want the regular expression to solve this issue
Try google, there are thousands of regex sites where you can try and test to your hearts content.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
i have implemented this code on the logout button
FormsAuthentication.SignOut();
Session.Abandon();
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl = "no-cache";
Response.Redirect("~/frm_default.aspx");
but when i click on back button i am able to go the previous page.
|
|
|
|
|
i think u have to add Headers to restrict Back view
Try this
Response.CacheControl = "no-store";
Response.AddHeader("Pragma", "no-cache");
Response.AppendHeader("Cache-Control", "no-store");
|
|
|
|
|
if u r using master pages, code this in page load of master page or in page load of everypage
Response.Expires = 60;
DateTime now = DateTime.Now.AddMilliseconds(-1);
Response.ExpiresAbsolute = now;
Response.AddHeader("pragma", "no-cache");
int timeout = (Session.Timeout + 1) * 60;
Response.AddHeader("Refresh", timeout.ToString());
Response.AddHeader("cache-control", "private");
Response.CacheControl = "no-cache";
if (Session.IsNewSession)
{
Response.Redirect("~/Default.aspx");
}
and in logout
Session.Abandon();
|
|
|
|
|
This is fine but then when i am on a page (not logged out) and then i click back button it does not take me to the previuos page. ihave to click refresh to get the page.
|
|
|
|
|
browser cache always remains open..
you cant erase bowser cache programmatically.
Only you can do, is when user clicks anything on a page after logoff, throw some error messages.
|
|
|
|
|
Hi,
On the Page Load write
if Session("UserId")="" then
Response.Redirect("Login.aspx")
end if
if you click back now, the page will execute the page load na...it will go to login page.
Ramesh Sambari
|
|
|
|
|
Hello friends
i am having a little issue hope anyone can help me out.
i have a situation my masterpage location changes due to some security requirements, so i am storing Foldername in Web.Config in AppSetting
like this --> add key="adminFolder" value="~/Temp/"
e.g
so i dont need to change everywhere when i have to update the foldername and getting back in Page Load event.
String adminFolder = System.Configuration.ConfigurationManager.AppSettings["adminFolder"];
protected void Page_PreInit(Object sender, EventArgs e)
{
this.MasterPageFile = adminFolder + "MasterPage.master";
}
this approach help me out to solve dynamically assign the foldername of master page
but i cant see Design View of my Code because i dont know how cant i link "adminFolder" Key in the Top of aspx file
|
|
|
|
|
hiii,
I am having a small doubt regarding the querystring ....
In my application there is a form with two pages..
I like to edit the details within the form for this i used a gridview
and querystring....taking the id value in the querystring i got the
details for the first page....
i kept edit&continue button at last which will redirect the page to
second page....
how to get the details in the second page basing on the id value
which we took in the first page....
how to write the querystring plz help me....
|
|
|
|
|
hi
You get query string value like this
String str=REquest.querystring("id")
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
hi
Code behind:
Dim dgitem As DataGridItem
For Each dgitem In Dgdisplay.Items
If cacheRankingName = "cumulativeranking" Then
'If dgitem.ItemType.Item = ListItemType.Header Or dgitem.ItemType.Item = ListItemType.AlternatingItem Or dgitem.ItemType.Item = ListItemType.Item Then
Dim dt As New DataTable
qrytoExecute = "select playerid, firstname , lastname, scores.points as leaderboarddisplay from scores " & qrytoAdd
qrytoExecute &= "group by scores.playerid order by leaderboarddisplay desc, playerid limit 30 "
dt = DBManager.GetDataTable(qrytoExecute)
For i = 0 To dt.Rows.Count - 1
Dim id As String = dt.Rows(i)("playerid").ToString()
Dim Query As String = "select concat(p.firstname,p.lastname) as Name from player p join scores s on s.playerid=p.userid where s.playerid=" & id
Dim retVal = DBManager.GetScalar1(Query)
Dim lbl As Label
Dim intCounter As New Integer
Dim str As String = DirectCast(dgitem.Cells(0).Controls(0), Label).Text
'If txtHNGet.Text = retVal Then
' 'flag = True
' dgitem.Cells(1).BackColor = System.Drawing.Color.DarkRed
'End If
Next
End If
'End If
Exit For
Next
End If
Html:
<asp:datagrid id="Dgdisplay" EnableViewState="False" Runat="server" PageSize="50" GridLines="None"
AutoGenerateColumns="False" Width="65%" AllowPaging="True">
<Columns>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Rank">
<ItemTemplate>
<asp:Label ID="lblrank" Runat="server">
<%#getRank%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Playername">
<ItemTemplate>
<a href='DisplayPlayerBioData.aspx?ids=<%#Container.DataItem("playerid")%>'>
<%#getPlayerName(Container.DataItem("firstname"),Container.DataItem("lastname"))%>
</a>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderStyle-Font-Bold="True" HeaderText="Count#">
<ItemTemplate>
<asp:Label ID="lblcount" Runat="server">
<%#DataBinder.Eval(Container.DataItem,"leaderboarddisplay")%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn Visible="False">
<ItemTemplate>
<asp:Label ID="lbl1" Runat="server">
<%#getPlayerName(Container.DataItem("firstname"),Container.DataItem("lastname"))%>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle Mode="NumericPages" ForeColor="#003300" PageButtonCount="2" HorizontalAlign="Right"
VerticalAlign="Top" Font-Bold="True"></PagerStyle>
</asp:datagrid>
i need to get datagrid cell value in codebehind..
here
Dim str As String = DirectCast(dgitem.Cells(0).Controls(0), Label).Text
//error displayed Specified cast is not valid.
Datagrid contain in webusercontrol
how can i get cell value...
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
hi try this,
Dim str As String= CType(dgi.Cells(0).Controls(0), Label).Text
and be sure that control(0) of cell(0) is text field
|
|
|
|
|
I am trying to start/stop a windows service in the code from a web application.The web application runs as IUSR_ComputerName, but this account does not have enough access rights to star/stop the service.
How do I impersonate the local system account, so that I can stop/start the service?
|
|
|
|
|
|
Hi...
I am trying have a dropdownlist which displays a calendar when the drop down arrow is clicked. I am having hard time in figuring it out. Plz tell me hw to achieve it.
Thanks in advance...
|
|
|
|
|
|
You can use the AjaxControlToolkit
With it you can assign a calendar to a textbox with almost no code at all
Alexei Rodriguez
|
|
|
|
|
Please Help Me Out :
I Want to Control The Client Browser i.e When ever a Specific URL Appears in the Client Browser Then The User Must be Redirected To Specified URL.
|
|
|
|
|
what is the problem with this.
If you programmatically want to do, just in your handler, try to transfer your response to the page if certain request occurs.
To get IP use
Request.Servervariables("REMOTE_ADDR")
You can get the absolute URI from this
Request.Url.AbsoluteUri
Now use Server.Transfer to the page.
Otherwise you can also use
<urlMappings enabled="true">
<add url="~/Info/Copyright.aspx" mappedUrl="~/Help/Copyright.aspx" />
<add url="~/Support/Contacts.aspx" mappedUrl="~/Help/Contacts.aspx" />
</urlMappings>
in Web.Config if you want this automatically.
|
|
|
|
|
My Websites are hosted, some times i got error as
Compiler Error Message: CS1056: Unexpected character ''
Error Reported is as
Source Error:
Line 1:
Line 2: áO浦浙á°潥
Line 3: 卤
Line 4: áO浦浙á°†捡ュュ潥
Show Detailed Compiler Output:
c:\windows\system32\inetsrv> "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /t:library /utf8output /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:
"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll"
/R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:
"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll"
/R:
"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll"
/R:"
C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll"
/R:
"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:
"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:
"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a7fd3a8e\282a6669\
assembly\dl3\a75afeae\db46742f_f447c901\SMSDLL.DLL" /R:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll"
/out:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a7fd3a8e\282a6669\App_Code.ckhtcfi8.dll"
/debug- /optimize+ /w:4 /nowarn:1659;1699;1701
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a7fd3a8e\282a6669\App_Code.ckhtcfi8.0.cs"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a7fd3a8e\282a6669\App_Code.ckhtcfi8.1.cs"
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
This is frequent Issue with webserver, the same code works fine with local testing servers.
When the error is reported, it is fixed in few mintues by host.
Can anybody tell me, what is the exact issue behing this
|
|
|
|
|
something tells me it has to do with text Encodings.
Char '' is ASCII another value than in other ISO-languages.
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Dear All,
Sorry for the repeat post, but i want the solution for this problem.
I have created a web application which includes crystal report for reports. Now the problem is that my reports were not working on the webserver.
The Application works Perfectly on my local machine in IIS and in .net environment but if i upload the same application on the web server it shows the error.
<per>
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
What could be the solution
Thanks and Regards
Yogesh Agarwal
|
|
|
|
|
yogesh_kumar_agarwal wrote: What could be the solution
Enable error reporting and see the error message. Once you fix it, disable the error reporting.
|
|
|
|
|
Hi, Thanks for the reply, I set the mode to off then i get the follwoing error message. Which is my actual problem that crystal report is not working on server.
Parser Error Message: Could not load file or assembly 'CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 73: </customErrors>
Line 74: -->
Line 75: <httpHandlers><add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></httpHandlers></system.web>
Line 76: <system.webServer><handlers><add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/></handlers><validation validateIntegratedModeConfiguration="false"/></system.webServer></configuration>
Source File: f:\inetpub\vhosts\aiivt.com\subdomains\market\httpdocs\web.config Line: 75
Yogesh
|
|
|
|