How To Retrieve A Custom Meta Tag In A Page
Mar 2, 2010
List<HtmlMeta> metas = new List<HtmlMeta>();
foreach (Control c in this.Page.Header.Controls)
if (c.GetType() == typeof(HtmlMeta))
{
HtmlMeta meta = (HtmlMeta)c;
if (meta.Name == "CategoryID")
strMeta = meta.Content;
}
[coder]...
View 2 Replies
Similar Messages:
Sep 9, 2010
I'd like to capture the http referrer url following the rendering of a custom error page.I have this set in my web.config
<customErrors mode="On">
<error statusCode="500" redirect="/StaticError.aspx" />
</customErrors>
In the OnLoad(EventArgs e) event -- I'm trying to do this, but it appears to be too late.this.txtReferrer.Text = Request.UrlReferrer.ToString();Is it possible to capture the referrer url?
View 1 Replies
Aug 28, 2010
Have a custom FieldTemplate (RadioButtonChooser_Edit.ascx) that shows a radiobuttonlist based on a single character. Using LinqtoSQL/DynamicData enabled.
Example G, F, P (Good, Fair, Poor).
If the custom metadata for a field in the table is set [Editable(false)] I get a G, F, or P. I would like to show the full word when editable is set to false. Not sure how to approach this.
View 1 Replies
Feb 10, 2011
create db driven meta keywords/description. I would store these records in a database, xml format i presume; since it would be per culture.How would i go about doing this?
View 4 Replies
Aug 28, 2012
I need to add Meta tags, description and keywords in aspx page. My aspx pages are in master page and I have already added meta tags and description in my Master Page.
Now I want add in my other pages also so if someone search my site on GOOGLE it should look like same as this:
[URL] ...
How to achieve this?
View 1 Replies
Mar 18, 2011
i m implimenting one web which requires the content of meta tag how i get the content?
View 1 Replies
Mar 11, 2010
i would like to know how to add meta tag into my aspx, if it is generated from a master page.i am using vb.net and visual developer.
View 7 Replies
Feb 17, 2011
I have a number of .aspx pages inheriting from a common master page. I need to insert <meta> tags into the master page and this varies from page to page. What is easiest and fastest way to get this done. The thing is, my site is already developed so I dont want to rework/rewrite any of the code.
View 4 Replies
Jul 28, 2010
I have a txt file with a list of <titles><meta keyword> and <meta description> and the link that these titles and tags should be associated with. how do i set the master page contentplaceholderid to read the text file and set the tags and titles accourding the the link on the txt file.
View 2 Replies
Jun 10, 2012
I populate mete tag from database according to this thread [URL] ....
In store.aspx page i have this behinde code
protected void Page_Load(object sender, EventArgs e) {
string data = Server.UrlDecode(Request.QueryString["BehCode"]);
SqlCommand _cmd = new SqlCommand("storeInfo", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cmd.Parameters.AddWithValue("@BehCode",data);
_cn.Open();
[Code] ....
Here instead of
stringkeyword = _dr[0].ToString();
I put
string keyword = _dr["Keyword"].ToString();
But when i run website and see viewsource it doesn't show any thing in meta tag.
View 1 Replies
Dec 15, 2013
I want to redirect to login page,when session is timedout. Here is the link i am following [URL] ...
For example: If i am in the page called http://localhost/RealWebApp/Dashboard/RealProfile.aspx
when session is timed out, this page is showing like http://localhost/RealWebApp/Dashboard/logout.aspx
But i wanted to be like : http://localhost/RealWebApp/logout.aspx
If I use like this in master page:
meta.Content = Convert.ToString(Session.Timeout * 60) + ";url=../LogOut.aspx";
then it is redirecting to http://localhost/Logout.aspx
But i wanted to be like : http://localhost/RealWebApp/logout.aspx
How to accomplish this:
protected void Page_Load(object sender, EventArgs e) {
HtmlMeta meta = new HtmlMeta();
meta.HttpEquiv = "Refresh";
meta.Content = Convert.ToString(Session.Timeout * 60) + ";url=LogOut.aspx";
this.Page.Header.Controls.Add(meta);
}
View 1 Replies
Dec 16, 2010
I have a Custom Control registered in the page using this code:
<%@ Register Assembly="WebProject.Core" Namespace="WebProject.Core.UserInterfaces.TinyMCE"
TagPrefix="tinyMCE" %> the Custom Control is placed on page with:
<tinyMCE:TextEditor runat="server" ID="uxContentAuthorInput" Mode="Full" />
To FIND the Control I use:
TextBox myContentAuthor = (TextBox)uxAuthorListDetailsView.FindControl("uxContentAuthorInput");
but DOES NOT WORK.
View 1 Replies
Feb 15, 2010
I have a simple site [URL]that I setup for my parents and other family member to share recipes on. The issue I have is that when I try to incorporate a google search the header is always RECIPE form from the dynamically driven site.
If page requested is [URL] in a SEO return I want it to have the title of the recipe to be Apple Sour Cream Crumble Pie not RECIPE FORM or RECIPE PRINT FULL FORM
How can I get this changed and also have metadata dynamically created to improve SEO returns?
View 1 Replies
Oct 17, 2010
how can i add title and meta tags for content pages in a project base on master and content page(dinamically) ?
i used the blow method for master page :
[code]....
and the error is :(in line *)
Error 17 'System.Web.UI.MasterPage' does not contain a definition for 'SetMetaTags' and no extension method 'SetMetaTags' accepting a first argument of type 'System.Web.UI.MasterPage' could be found (are you missing a using directive or an assembly reference?)
View 3 Replies
Oct 22, 2010
I want to create a custom control where I define several specifically named DIV sections. The code-behind logic of the custom control will perform operations on these named DIV sections. The page where the custom control is hosted needs to be able to add named controls to the DIV sections and perform operations on these named controls added to the DIV sections.
Let me explain a little further. In the custom control, I want to have code behind logic that fires the following Page Event and uses a condition to make one or another specifically named DIV section visible or not:
< _
ToolboxData("<{0}:BaseDetails runat=""server""></{0}:BaseDetails>") _
> _
Public Class BaseDetails
[code]...
how can I create a custom control which is able to generate the named DIV sections "DetailsNameDiv1" and "DetailsNameDiv2" where my custom control can check a condition and make one or the other visible. Also, I need to be able to add controls to these named DIV sections when I host the custom control and the control that I add to the named DIV section needs to let me set values of these controls from the code behind logic of the page (or usercontrol) where the custom control is being hosted (in my example, I am adding TextBox controls that I want to set the Text property from a SQL Data Reader).
View 3 Replies
Mar 8, 2010
I am trying out some code which enables me in creating a page with extension .asp2
The tags included will also be custom, something like:
[code]....
I have done the necessary changes so that ASP.NET identifies the extension. I have also kept a mapping of custom tags and asp.net/html tags with myself. With this I am able to render the page on browser. But how can we do event handling(usually done by page postbacks and code) in such a scenario?
View 1 Replies
May 7, 2015
I want put custom error page in my website so I wrote below code in web.config
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" subStatusCode="-1" prefixLanguageFilePath="" path="error-404.aspx" responseMode="ExecuteURL" />
</httpErrors>
is it correct?
or I should put other code?
View 1 Replies
Mar 24, 2010
Here's my Application_OnError event sink in global.asax.vb:
Sub Application_OnError(ByVal sender As Object, ByVal e As EventArgs)
Dim innerMostException As Exception = getInnerMostException(Me.Context.Error)
If TypeOf innerMostException Is AccessDeniedException Then
Security.LogAccessDeniedOccurrence(DirectCast(innerMostException, AccessDeniedException))
Dim fourOhThree As Integer = DirectCast(HttpStatusCode.Forbidden, Integer)
Throw New HttpException(fourOhThree, innerMostException.Message, innerMostException)
End If
End Sub
You'll see that if we've got an innermost Exception of type AccessDeniedException we throw a new HTTPExcpetion with a status code of 403 AKA 'forbidden'
Here's the relevant web.config entry:
<customErrors defaultRedirect="~/Application/ServerError.aspx" mode="On">
<error statusCode="403" redirect="~/Secure/AccessDenied.aspx" />
</customErrors>
So what we're expecting is a redirect to the AccessDenied.aspx page. What we get is a redirect to the ServerError.aspx page.
We've also tried this:
Sub Application_OnError(ByVal sender As Object, ByVal e As EventArgs)
Dim innerMostException As Exception = getInnerMostException(Me.Context.Error)
If TypeOf innerMostException Is AccessDeniedException Then
Security.LogAccessDeniedOccurrence(DirectCast(innerMostException, AccessDeniedException))
Context.Response.StatusCode = DirectCast(HttpStatusCode.Forbidden, Integer)
End If
End Sub
Which unsuprisingly doesn't work either.
View 1 Replies
Oct 18, 2010
i have two user control page how to retrive text box and drop down value in both page in our aspx page
View 2 Replies
Jan 2, 2011
I am currently able to pass parameter from 1 page to another but I am unable to retrieve it.
<asp:HyperLinkField DataNavigateUrlFields="ID"
View 5 Replies
Dec 7, 2010
I have a master page with a form on it. It's a people search form. When the user clicks on the search button it goes to the search results page that uses the same master page. With the code below I get the info off the master of the current page. Howdo I grab that info from the first page?
Here's the code:
Master page:
< FORM id=formEmpSearch method=post action=~/About/peopleSearch.aspx runat="server">
< asp:TextBox style="WIDTH: 153px; HEIGHT: 12px" id=txtSearchName onfocus="this.value=''" runat="server" CssClass="searchBox">
Master Code Behind page:
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Partial Class mstrIntranet
Inherits System.Web.UI.MasterPage
Public Property mSearchName()
Get
Return txtSearchName.tex
End Get
Set(ByVal value)
txtSearchName.text = value
End Set
End Property
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
txtSearchName.Text = "People Search"
End Sub End Class
Search Results Code Behind page:
Partial Class PeopleSearch2
Inherits System.Web.UI.Page
Public SearchName As String
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim mpTextbox As TextBox
mpTextbox = CType(Master.FindControl("txtSearchName"), TextBox)
SearchName = mpTextbox.Text
View 1 Replies
Jul 29, 2010
I have two tables - Advert and Student
adID is the primary key (Advert) and acts as the foreign key for Student
I have two pages, both of which each have a detailsview in insert mode
what I want to achieve is to create a new record in advert.aspx (e.g. adID = 4), then when item is inserted, redirect to page student.aspx (which a student record is created) where the foreign key is the ID from the advert just created (e.g. student.aspx?adID=4).
View 1 Replies
Feb 10, 2010
Background:I'm building a custom control as a base class that derives from CompositeControl. It consists of a FormView, a ObjectDataSource and a CRUD-Button Series (Create, Read, Update, Delete - Buttons). I'm loading the different FormView templates within the deriving classes dynamically from file with Page.LoadTemplate().
Class structure:
TabControlBase:CompositeControl
Employer:TabControlBase
Applicant:TabControlBase
Each deriving class knows the specific template-paths for loading FormViews templates.
The ObjectDataSource is connected with a DAL using a Select and an Update Method. The Select-Method works fine: When loading the CompositeControl the data of the DAL are shown in the Labels of the embedded FormView (ReadOnly-Template). When I'm switching to Edit Mode the data also are displayed in the TextBoxes (Edit-Template).
The problem occurs when I'm trying to update data using the "Save" - Button: The connected DAL-Method is calling properly, but the parameters all are NULL.Tree structure of this custom control:
Panel -
--- FormView
EditTemplate (ascx): Name, Name1, Segment
--- ObjectDataSource
--- CRUD-Button Stack: New, Edit, Delete, Save, Cancel, Copy, Print
All controls will be added dynamically in the base class "TabControlBase" within the overridden CreateChildControls - method. The CreateChildControls method is called by the deriving classes e.g. Employer after setting specific properties e.g. templates,
object data source methods etc.The control is placed in a simple abc.aspx-Page. What I detected so far on PostBack
- When I'm looking at the ViewState Collection within the OnLoad-method of the abc.aspx the ViewState-Collection is Null (Count = 0)
- It seems that the control tree is empty. I'm not able to find any control using a proper working recursive FindControlMethod
- Only the Page.Request Collection shows the expected controls
Conclusion for now:It seems that the CompositeControl "forgets" the values of the FormView TextBoxes on PostBack. It seems it has to do with ViewState Management.
View 2 Replies
Feb 23, 2011
when I asked recenlty a question about how To retrive a control in a Master Page from Content Page. Many peoples use this code from my Content Page:
Label lbl = this.Master.Page.FindControl("uxLabel") as Label; //Note any server controls defined in the master page could be not be accessible even after a cast is performed, because they could be marked as protected
This approach certainly works, I also realise that is available a strongly-typed solution that doesn't involve casting the Master property.
In the Master Page place:
[code]....
View 1 Replies
Oct 22, 2010
I have to use inline code for an aspx page and I need to use a custom server control that is defined in the same aspx page but the control does not get processed as a server control. it gets returned as is as static html tag.
View 3 Replies