I have an HTML Helper that essentially renders static content read from HTML files (inside of a vdir). There are cases when the HTML file has a title element defined and in such cases, the current page should use the given title. The content inside of the body should be rendered where the Helper class is referenced in the View.
This is how I call the helper.
<%=Html.StaticContent("staticcontent.htm",
new List<StaticContentTag>()
{
new StaticContentTag()
{TagKey=ReplaceTags.MarketName,
TagValue = "Austin"}
}, Model, true) %>
I'm passing in the ViewModel so that I can set the title and the last parameter is a flag that says whether to force the title or not.
The head has the title defined like this.
<title><%=Model.Title%></title>
I know what I'm doing wrong here by referencing the Model.Title element before even calling the helper. Any ideas on how I can work around this?
I have a title in my master page, say, "I am master". In my content page, in the page_load event, I change it to:Me.Title = Me.Master.Page.Title & ", I am content"So I expect the title to be "I am master, I am content". However, it just shows ", I am content". This has been working so far.
I guess I might be missing something easy (or not) here. I have a class in App_Code which do some validations over Session and Request.Url, till here it's working fine. But then I need to get the actual page title. I know it's simple to get it in the page's code behind, but could I get it in a separate class like it is on my scenario?
am currently stuck with this problem of displaying an image using HtmlHelper class.Here is what i have. I have a custom HtmlHelper class which supposed to display an image:
[Code]....
[Code]....
I managed to get to the controller, but image shows as null. Is there a way around it ? or maybe an even better way to do this?
I'm trying to override all the Html.TextBoxFor etc. methods. I want to make them non-static methods in a class that extends ViewUserControl. But, according to intellisense, Html does have access to these methods; they simply don't appear. So basically I want to do something like:
[Code]....
But I'm not getting the syntax right.
Basically just trying to wrap the TextBoxFor call so that my ViewUserControl can drop in a unique id each time.
I saw this implemented somewhere but basically below I'm using the textbox HTMLHelper to draw a textbox with the id myID and default text 'text_goes_here'. I want to also add a class to thiis helper, i saw somewhere it implemented with new {@class =''} as a third parameter creating an object but im not sure exactly how its wrote
I want to use a single Crystal report (.rpt) file for two actual reports, changing only the title and the data. I've got the data working, but I can't seem to get the title part right. I tried to follow this
tutorial, but when I do my report just disappears (whether I set the parameter or not). I created a "Report Title" special field and dragged it to my page header. Then I brought up the formula editor on the report title display string and clicked on my title parameter. So the formula ends up being
{?Title}
I'm sure I'm probably just making a rookie mistake here.
I'm using user controls as web parts in an asp.net application. I have skinned the webparts by adding .PartTitleStyle (etc) to my css. I'd now like to let the user select from a list in an editor part to choose the style for the web part.I'm able to change the title for the webpart, but can't seem to figure out how to change the css to use .PartTitleStyleCustom instead of the default, even trying to set the wp.BackColor seems to have no effect. Here is the code I have so far in the page load event of my user control:
I would like to extend the HtmlHelper by using metadata (similar to DataAnnotaions metadata). Specifically I want to be able to add a 'Title' attribute to html controls that will then appear as a tooltip on the control. I would like to keep the tooltip text with my model, for example by adding 'Tiltle' metadata to the model as follows:
[DisplayName("User Id")] [Title("Enter your 10 digit user id")] property UserId { get; set; }
So the questions are:
1. How do I add metadata (such as 'Title') to my model?
2. How do I access this metadata in my HtmlHelper extension method?
i'm trying to set different css class on an action link, it's very easy with a regular one, but i'm strugeling with this one:
[Code]....
i figured out already that using the viewdata["culture"] will not work, since i didn't set a culture in the controler. but i do get the /en/ in the link itself.
the question is how do i do it? i have a localization helper, but can i do it there ?
<asp:Content ID="TitleContent1" ContentPlaceHolderID="PageTitlePlaceHolder" runat="Server"> My Page </asp:Content>
This works by placing the content page specific title on the page ("My Page" in this example). Now I want to add a global prefix to the title in my master page for the site name. So I want:
It renders Fine with Register symbol after the text "My Test Application Name" on start of the page but on any postback the title turn into My Test Application NameŽ Kindly let me know what can i do with minimal effort to fix this issue
Every time I create a new aspx page and add some new photos and text, after I finish, I have to update page title, Web.sitemap, Sitemap.xml to feed search engines, static sitemap.aspx page, add photos to proper folders, update database to display feeds etc, and I have to remember to upload all new files including links to any new pdfs....This routine eats my time and drives me crazy.
I was wondering if there is such interface, where you need to create only 1 aspx page, for example "Articles" which can populate Texts, photos etc into pre-defined sections, but at the same time it displays with different URL's, so there is a permanent link to it. After you finish it creates a title automatically, based on article title, populates Web.sitemap - does all the dirty work. Similar to how blog engines, Joomla and Drupal work.
In the development, it works nicely. Until I deported to production, I realise that the component that use those thing .. it just hang. I found that under BIN when it compiled dewaCorp.EUC.TelcoDB.Data.dll.config and open up that file and turn out nothing.
what I am trying to do is add a method to my gridview's sorting event to add a class to the column being sorted so the user can know if the data is being sorted ascending or descending and on what column. I am currently trying to do it through a switch statement on the sort expression to determine what column it's coming from but I am unaware of how to set the css class.
We are trying to use a BasePage class (which inherits from Page) to populate and set the Meta Keywords and Meta Description Tags. I am using masterpages and below is an example code extract... According to examples on the internet, I could then set this also via the Page Directive using the MetaKeywords and MetaDescription properties, but they do not appear.
I have tried setting the CodeFileBaseClass="MyNamespace.UI.BasePage" but this does not work either. Using debug I can see that the BasePage classes' MetaKeywords and MetaDescription properties are not being set within my content page. I can access the properties but not set them.
how to set the body class of a ContentPage when using master pages?
I want to set the body class so that certain elements of my page are styles differently from each other. e.g. Navigation links to so which is the current page.