Click here to Skip to main content
15,885,365 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionConfigurationManager.GetSection method Pin
indian1431-Aug-11 9:38
indian1431-Aug-11 9:38 
AnswerRe: ConfigurationManager.GetSection method Pin
Shameel4-Aug-11 23:16
professionalShameel4-Aug-11 23:16 
QuestionError checking in application Pin
vanikanc1-Aug-11 2:58
vanikanc1-Aug-11 2:58 
AnswerRe: Error checking in application Pin
Not Active1-Aug-11 3:14
mentorNot Active1-Aug-11 3:14 
QuestionChanging Table's Image [modified] Pin
Eddie19871-Aug-11 2:57
Eddie19871-Aug-11 2:57 
AnswerRe: Changing Table's Image [modified] Pin
Not Active1-Aug-11 3:18
mentorNot Active1-Aug-11 3:18 
GeneralRe: Changing Table's Image Pin
Eddie19871-Aug-11 3:23
Eddie19871-Aug-11 3:23 
Questionremoving aspx extension Pin
benams31-Jul-11 22:44
benams31-Jul-11 22:44 
Hi,
I want to remove the extension of my asp.net webpages(I have a webapplication).
I've read some guidelines about the issue but I've found some simple ways to do it.
I've tried adding the following lines to my web.config file:

<rewrite>
      <rules>
        <clear />
        <rule name="san aspx">
          <!--Removes the .aspx extension for all pages.-->
          <match url="(.*)" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="{R:1}.aspx" />
        </rule>
      </rules>
    </rewrite>


I have also tried to add this function to Application_BeginRequest in my global.asax file:
C#
string curruntpath = Request.Path.ToLower();
        curruntpath = curruntpath.Trim();
        if (curruntpath.EndsWith(".aspx"))
        {
            string finalurl = curruntpath.Substring(curruntpath.Length - 5, 5);
            HttpContext.Current.RewritePath(finalurl);
        }


In the first case, when I type "www.site.com/page" I'm being redirected to "www.site.com/page.aspx"(which is my wanted page), but when I type "www.site.com/page.aspx" I want the shown URL to be "www.site.com/page", and it doesn't happen.
In the second attempt I just can't get any page when typing "www.site.com/page.aspx".

What should I do in order to solve it?
Questiononfocus postback problem Pin
minckle31-Jul-11 12:06
minckle31-Jul-11 12:06 
AnswerRe: onfocus postback problem Pin
Not Active31-Jul-11 13:24
mentorNot Active31-Jul-11 13:24 
GeneralRe: onfocus postback problem [modified] Pin
minckle1-Aug-11 13:30
minckle1-Aug-11 13:30 
GeneralRe: onfocus postback problem Pin
Not Active1-Aug-11 14:24
mentorNot Active1-Aug-11 14:24 
Questionhow to get previous page and details remain Pin
Cyberoxy31-Jul-11 9:50
Cyberoxy31-Jul-11 9:50 
AnswerRe: how to get previous page and details remain Pin
Not Active31-Jul-11 13:22
mentorNot Active31-Jul-11 13:22 
AnswerRe: how to get previous page and details remain Pin
Bernhard Hiller31-Jul-11 19:45
Bernhard Hiller31-Jul-11 19:45 
QuestionHow to replace image onmouseover Pin
Eddie198730-Jul-11 9:12
Eddie198730-Jul-11 9:12 
AnswerRe: How to replace image onmouseover Pin
Shahriar Iqbal Chowdhury/Galib31-Jul-11 4:16
professionalShahriar Iqbal Chowdhury/Galib31-Jul-11 4:16 
GeneralRe: How to replace image onmouseover Pin
Eddie19871-Aug-11 1:09
Eddie19871-Aug-11 1:09 
GeneralRe: How to replace image onmouseover Pin
Not Active1-Aug-11 2:08
mentorNot Active1-Aug-11 2:08 
QuestionHave Session in Global.asax File Pin
Member 322226430-Jul-11 6:29
Member 322226430-Jul-11 6:29 
AnswerRe: Have Session in Global.asax File Pin
Keith Barrow30-Jul-11 8:23
professionalKeith Barrow30-Jul-11 8:23 
Questionneed to display data on email Pin
CyberHeart 230-Jul-11 6:20
CyberHeart 230-Jul-11 6:20 
AnswerRe: need to display data on email Pin
Not Active30-Jul-11 13:01
mentorNot Active30-Jul-11 13:01 
QuestionRender ASP.Net code at run time Pin
Dilan200630-Jul-11 3:06
Dilan200630-Jul-11 3:06 
AnswerRe: Render ASP.Net code at run time Pin
Ali Al Omairi(Abu AlHassan)30-Jul-11 7:05
professionalAli Al Omairi(Abu AlHassan)30-Jul-11 7:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.