Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

asp.net c#

Posted on 2011-03-09
9
Medium Priority
?
261 Views
Last Modified: 2012-05-11
I tried to read the domain by using

http://localhost:46232/Legend/testbyrick.aspx

        Response.Write("http://" + Request.Url.Host);
        Response.Write("<br>http://" + Request.ServerVariables["REMOTE_ADDR"]);
First one just return localhost.
Second one returns ip.

I actually need to return localhost:xxxxx

How can do that?
0
Comment
Question by:Webboy2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
9 Comments
 
LVL 36

Expert Comment

by:Miguel Oz
ID: 35090208
Use:
Request.Url.AbsoluteUri
for the full path
and
Request.Url.Authority
for the localhost:portinfo
0
 
LVL 10

Expert Comment

by:hosneylk
ID: 35090347

Uri url = Request.Url;
Response.Write(uri.Scheme + Uri.SchemeDelimiter + uri.Host + ":" + uri.Port);

Open in new window

0
 

Author Comment

by:Webboy2008
ID: 35090396
I need to do this one the frontend apsx
like this.

 <obout:Grid id="grid1" runat="server" CallbackMode="true" Serialize="true" AutoGenerateColumns="false"
                AllowGrouping="true" ShowMultiPageGroupsInfo="true"
                  OnRebind="RebindGrid"
                  GroupBy="LoweredUserName"
                   FolderStyle="http://localhost:46232/xxx/Oboutstyles/Grid/premiere_blue"


how can i replace the localhost:46232?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 10

Expert Comment

by:hosneylk
ID: 35090411
you could do this on page_load

e.g.
Uri url = Request.Url;
grid1.FolderStyle = uri.Scheme + Uri.SchemeDelimiter + uri.Host + ":" + uri.Port + "/xxx/Oboutstyles/Grid/premiere_blue";

Open in new window

0
 
LVL 36

Accepted Solution

by:
Miguel Oz earned 2000 total points
ID: 35090438
Try:
FolderStyle="<%=Request.Url.AbsoluteUri%>"
0
 
LVL 10

Expert Comment

by:hosneylk
ID: 35090465
can't you do this instead?
Uri url = Request.Url;
grid1.FolderStyle = ResolveClientUrl("~/xxx/Oboutstyles/Grid/premiere_blue");

Open in new window

0
 
LVL 10

Expert Comment

by:hosneylk
ID: 35090470
ignore the Uri declaration in the previous comment.

i.e. just

grid1.FolderStyle = ResolveClientUrl("~/xxx/Oboutstyles/Grid/premiere_blue");

Open in new window

0
 

Author Comment

by:Webboy2008
ID: 35094157
I need to do on frontend...
<obout:Grid id="grid1" runat="server" CallbackMode="true" Serialize="true" AutoGenerateColumns="false"
                AllowGrouping="true" ShowMultiPageGroupsInfo="true"
                  OnRebind="RebindGrid"
                  GroupBy="LoweredUserName"
                   FolderStyle="http://localhost:46232/Legend/Oboutstyles/Grid/style_5"

                  >
                  <Columns>
                  <obout:Column ID="Column1" DataField="LoweredUserName" Visible="false" HeaderText="Sale Name:" runat="server" />
                  <obout:Column ID="Column2" DataField="CustName"  HeaderText="Customer Name"  runat="server" />
                  <obout:Column ID="Column3" DataField="MeetingCityState"  HeaderText="City / State"  runat="server" />
                  <obout:Column ID="Column4" DataField="MeetingType"  HeaderText="Type"  runat="server" />
                  <obout:Column ID="Column5" DataField="DescLeadSource"  HeaderText="Lead Source" runat="server" />
                  <obout:Column ID="Column6" DataField="BeginDate" DataFormatString="{0:d}"   HeaderText="Meeting Date"  runat="server" />
                  <obout:Column ID="Column7" DataField="TimeIn"  HeaderText="Time In"  runat="server" />
            
0
 
LVL 10

Expert Comment

by:hosneylk
ID: 35094223
what happens if you give a relative url?

e.g.
FolderStyle="~/Legend/Oboutstyles/Grid/style_5"

or 

FolderStyle="Legend/Oboutstyles/Grid/style_5"

Open in new window

0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question