How To Link Two Pages In .net
Feb 28, 2011Say if i have a master page in that i have a button if user clicks on the button he should be redirected to new asp page how can i do that.
View 4 RepliesSay if i have a master page in that i have a button if user clicks on the button he should be redirected to new asp page how can i do that.
View 4 RepliesMy requirement was to share master files among diff projects i read this doc [URL] so i use this technique to share msster pages among my diff projects in a soln but i dnt know how to reference such shared master page as if i use such
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../masterPages/masterInvGen.Master"
I have a layout page (or master page) with MVC 3 and would like to make my views sort of content pages to this layout page, but alas I have no clue how to do this.
View 2 RepliesI have a search page (Search.aspx) with a search textbox. I would also like to add a search box to my homepage (Default.aspx) so that the viewer can immediately start searching.
I am aware I could do this by adding the search box to the Master template and using a ContentPlaceHolder, however I don't wish to do this for two reasons:
- The width of the Search.aspx textbox is quite wide - too wide for Default.aspx (the location I have for it)
- I am not yet convinced that I want this search box to be present on ALL my pages.
- I am considering using different AJAX Watermark Extender texts for the two search boxes.
How can I link the two textboxes with VB.NET? I want to be able to:
- Type a keyword into the Default.aspx search textbox, press the Return key (there is no Search button on
Default.aspx but there is in Search.aspx) and be taken straight to Search.aspx with the returned search results!
- Have the keywords transferred to the search textbox in Search.aspx so that they are sitting there waiting for me when Default.aspx takes me there.
.net and I love it already,how to make my LOGO (not image just a text) on my website clickable as back to home link but ONLY on some pages? I have the logo text on my Site.master page but as soon as I make the logo as a link then the logo will be clickable even though I am already on the home page which is pointless.
.net so please no black magic explanation ok?)
I have create a page with out link to master page. I want to edit this page to connect to master page. How do I do that?
again with another explanation
I'm using add content page to add page connected to master pages
If I create pages with out add content page how do i add this page to master pages;
I've got menu in my ASP MVC project, and can when I use
<li><%= Html.ActionLink("My", "My")%></li>
it redirects me to .../Home/My
and if I got
<li><%= Html.ActionLink("My", "My", "ZZZ")%></li>
it redirects me to .../ZZZ/My
the problem is I've got some pages out of MVC , with simple Inherits and they are in the root so I need to got to /My.aspx
How can I redirect to /My.aspx in my MVC menu ?
I've been rewriting my page into a master page for a bit now, problem I have is that I want the current page I'm in to be highlighted in the link.If you go to my website now gabriel-g.net and click on any menu item, it will let you know what current page you're on by staying underlined/highlighted.How can I accomplish this dynamic change in a master page -without having to recreate the menu in every page- with content holders?
View 1 RepliesI'm creating a website where I want people not to be able to create link to certain pages.The site work like this: The user do a serch for a document and click the link to view it, then he can view the document. If the user somehow adds the URL to favorites he should not be able to view the document when he at some time later tries to view the document. In addition if the user sends the URL to other people they should not be able to view the document.
View 6 RepliesI'm currently using ASP.NET MVC 2 and the spark view engine. The main master page (application.spark) contains all of the CSS link tags that need to be present for all pages (global stuff). However, I have some content pages that have page specific CSS tags and currently I'm just sticking the link tag in the body as something like:
<content name="MainContent">
<!-- page specific csss -->
<link rel="stylesheet" href="/Content/css/page_specific.css" />
My problem is that when the page renders, this tag ends up in the which is not where it needs to be. Is there a solution for this?
I had was to check the controller in the Application.spark page and write out which page specific css file is required for that particular controller, however, that solution doesn't seem to scale well and I would imagine there is some way of creating the link in the child page and having it render where it's supposed to by the browser.
Consider the following scenario.You have a Edit action (GET and POST) for an entity that multiple pages link into (GET EDIT). What is the best way of getting back to the page that linked to the edit action? Adding a returnTo url in the query?
Example, from MyCart/3 we have a edit product link
/Product/Edit/5?returnTo=MyCart/3 (but url encoded)
And from Producer/45 we have this link
/Product/Edit/5?returnTo=Producer/45
Is there a better way to do this?
I use freetextbox control to rich text.When I insert an image with imagegalley it creates a link:
<A>http://www.freetextbox.com "target = _blank> FreeTextBox </ A>.
Here is my requirement -
1. I need to load a user control on link click event of a link button during postback of aspx page.
2. On button click event of a save button on that aspx page, I need to read the selected values from that user control on further postback.
If I write the loadcontrol code in link_click event, the control is not recognized at all in the button_click event. When I shift it to page_init and execute only during not postback, the user control loads with default values.
I have set link color as red and vlink as yellow and green color for alink but the color shown for links is always green for visted and active link?
View 5 RepliesAfter submitting a form, the user is presented with a link to a pdf document. The link is straight to the document, it is not streamed.
If the user right-clicks and chooses 'save link as,' the document saves and opens fine. However, if the user just clicks on the link, the browser takes a very long time to respond (I'm going to guess it's 3 minutes) and then adobe reader gives the following error:
"the file is damaged and could not be repaired"
This is in Chrome v5, ASP.NET 3.5 and the link is returned inside an UpdatePanel.
I want to create link thumbnails and get link contents like facebook in asp.net, but i couldn't find any resource.
View 1 RepliesFor example, i browse the web page in browser, at first, i clink "home", home page is show out, then i click the "Contact us", then the "contact us" web page is showing out, BUT the problem is come out when i try to click the home page again, the home page doesn't come out and still at the contact us page...any1 know WHY?Thank you for helping...
View 4 RepliesI have a SiteMapPath control and instead of default functionality like
Home > Accounts > User Account
where "User Account" refers to ~/UserAccount.aspx
I would like to overwrite the last node to show info about a current user, i.e.:
Home > Accounts > John White and "John White" refers to ~/UserAccount.aspx?id=111 ?
Created a asp page using vbscript to calculate a value (works fine). I'd like to return the value as a clickable link, which would obviously redirect the user somewhere else.
View 9 Repliesi'm developing a site using VS2010 and with my windows vista busniness OS. i used the default VS2010 wizard for new web application to create it. included a folder in the root directory and created new aspx pages to derive from the master page in the root directory of my site. everything shows on the new pages except the jpeg image logo in the master page. But other aspx pages i created in the root directory shows every thing fine.
View 1 RepliesPage B - loads slowly and needs to do some CPU-intensive operations on the web server.
I noticed that when someone is loading Page B, then Page A also loads slowly. This is even worse if multiple users are loading Page B at the same time. Page A won't finish loading until Page B is done.
Is there a best practice for making sure that Page A can still load quickly? Maybe a config setting or IIS setting that I need to change from its default? With 2 users loading Page B at the same time, the web server CPU usage only gets to 30% so I suspect it might be something I can tweak with the settings.
Currently I'm doing common functionality required throughout my site inside of my masterpage. What I want to do is move this functionality to a BaseClass so All my pages inherit from the Base Class. However, I'm not sure how to set this up interms of c# code with regards to Using a Base Class and then having a masterpage applied to my aspx pages that i create.
View 5 RepliesIn my Application_BeginRequest I have code that gets query string value ?c=FR or ?c=US and store it in cookies.Based on query string value I have either US or FR,locale is selected from locale table.If ?c=FR then locale will be fr-FR and if it is US then locale will be en-US.My code is below.
void Application_BeginRequest(object sender, EventArgs e)
{
LocalizationInfo loc = GetLocalizationInfo();
if (Request.Cookies["Localization"] == null)
Response.Cookies.Add(new HttpCookie("Localization"));
Response.Cookies["Localization"]["Country"] = loc.Country;
CultureInfo objCI = new CultureInfo(loc.Locale);
Thread.CurrentThread.CurrentCulture = objCI;
Thread.CurrentThread.CurrentUICulture = objCI;
}
public static LocalizationInfo GetLocalizationInfo()
{
string countryCode = "";
string sLocale = "";
if (HttpContext.Current.Response.Cookies["Localization"]["Country"] != null)
countryCode = HttpContext.Current.Response.Cookies["Localization"]["Country"];
if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["c"]))
countryCode = HttpContext.Current.Request.QueryString["c"];
if (countryCode == "")
countryCode = "US";
sLocale = HertzRent2Buy.DataProvider.ListData.GetLocale(countryCode);
LocalizationInfo ret = new LocalizationInfo();
ret.Country = countryCode;
ret.Locale = sLocale;
return ret;
}
public struct LocalizationInfo
{
public string Country;
public string Locale;
}
Now when I run the project and in query string I set [URL] then for the very first page(home page itself) it shows me French translation,but on subsequent page,that query string parameter ?c=FR is lost and hence it shows be English translation not French translation since it does not pickup French resx file.If I manually append ?c=FR in subsequent page then it shows the French translation.Is there is way how I can make that query stringparameter available in all pages.Structure is there to hold Country and locale variables. In all pages I am calling GetLocalizationInfo() method as follow
LocalizationInfo info = some.DataProvider.Globalization.GetLocalizationInfo();
And I create instance info to pass locale and country as parameter. GetProductDetails(id,info.Country,info.locale). why my query string parameters get lost on subsequent pages.
When i'm trying to debug or view pages of my site in browser asp.net dev server doesn't turns on pages automatically and when im trying to go by url it throws me an error See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ComponentModel.Win32Exception (0x80004005): Не удается найти указанный файл
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.VisualStudio.WebServer.WebServerForm_DAL.DoLaunch()
at Microsoft.VisualStudio.WebServer.WebServerForm_DAL.OnLinkClickedHyperlinkLinkLabel(Object sender, LinkLabelLinkClickedEventArgs e)
at System.Windows.Forms.LinkLabel.OnLinkClicked(LinkLabelLinkClickedEventArgs e)
at System.Windows.Forms.LinkLabel.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)............................
I have a few pages that are completely static. They only change at build time. But they are expensive to create. For the ones that are kind of expensive to create, I cache them for very long times using the ASP.NET output caching. But for one page, I really want it cached forever and ever or until the the next build.
What is the most expedient way to make this happen? Is there a build in feature that achieves this or a 3rd party tool?
(yeah, for the moment I plan to do the "view source" and copy paste thing, which isn't a very elegant build step)