Thanks for that, can you provide some further information, should I include first code in showad.aspx.vb and then modify showad.aspx for title section.
Copied in your code pretty good except 1 error I cannot understand or fix,
Error 1 Name 'YourCondition' is not declared. C:\Users\The Marsden\Desktop\Fatdog\WEB DESIGN\localstar\localstarMASTER\ShowAd.aspx.vb 73 12 C:\...\localstarMASTER\
The check for yourcondition is that for instnace you are checking that there is description available or not you can simply change it to follwoing if there is no condition
Protected Sub Page_Load(ByVal sender
As Object,
ByVal e As EventArgs)
If (Not IsPostBack)
Then
Page.Header.Title =
"AdTitleLabel"
End
If
' Check if the URL querystring contains a valid ad.
Dim adId
As Integer = DefaultValues.IdNullValue
Dim adIdQs
As String = Request.QueryString("id")
If Not (adIdQs
Is Nothing)
AndAlso Not (Int32.TryParse(adIdQs, adId))
Then
Response.Redirect("~/Search.aspx")
End If
If Not Page.IsPostBack
Then
If User.Identity.IsAuthenticated
Then
Me.ResponseContactEmailTextBox.Text = Membership.GetUser().Email
Me.EmailSenderAddressTextBox.Text = Membership.GetUser().Email
Me.ResponseContactNameTextBox.Text = Profile.FirstName &
" " & Profile.LastName
Me.EmailSenderNameTextBox.Text = Profile.FirstName &
" " & Profile.LastName
End If
End If
End Sub
Member
48 Points
150 Posts
How to show advert titles Show Ad "title"
May 08, 2008 07:17 AM|roymartian|LINK
Hi Guys,
I would like to show adverts descriptions rather than title "Show Ad" as an example in page text.
See, http://www.localstar.com.au/ShowAd.aspx?id=41
Any ideas ?
Contributor
4232 Points
2392 Posts
Re: How to show advert titles Show Ad "title"
May 08, 2008 07:41 AM|kamii47|LINK
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (your condition)
{
Page.Header.Title = "Your Title";
}
}
}
in aspx make sure header have runat="server" like <head runat="server">
(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
Member
48 Points
150 Posts
Re: How to show advert titles Show Ad "title"
May 08, 2008 08:06 AM|roymartian|LINK
Kamii,
Thanks for that, can you provide some further information, should I include first code in showad.aspx.vb and then modify showad.aspx for title section.
Sorry I am a bit green.
Thanks,
Roger.
Contributor
4232 Points
2392 Posts
Re: How to show advert titles Show Ad "title"
May 08, 2008 08:20 AM|kamii47|LINK
Yes
1 ,In ASPX <head runat="server">
2, In code behind
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (your condition)
{
Page.Header.Title = "Your Title";
}
}
}
(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
Member
48 Points
150 Posts
Re: How to show advert titles Show Ad "title"
May 08, 2008 08:38 AM|roymartian|LINK
Kamii,
Sorry to labour this mate,
1. <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" CodeFile="ShowAd.aspx.vb"
Inherits="ShowAd_aspx" Title="Show Ad" %>Should I change to;
<%
@ Page Language="VB" MasterPageFile="~/MasterPage.master" CodeFile="ShowAd.aspx.vb" Inherits="ShowAd_aspx" Title=head runat="server" %>2. Not sure where to add this as all shown as Protected Sub sections?
Grateful if you could walk me through sorry.
Contributor
4232 Points
2392 Posts
Re: How to show advert titles Show Ad "title"
May 08, 2008 08:42 AM|kamii47|LINK
you are using master page
so in your master page do like this
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="AuthenticatedUsers.master.cs"
Inherits="MasterPages_AuthenticatedUsers" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
....
<head id="Head1" runat="server"> is the line what you have to change
then let this be as same
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" CodeFile="ShowAd.aspx.vb"
Inherits="ShowAd_aspx" Title="Or let it empty" %>
now in code behind do as i have mentioned u before
(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
Contributor
4232 Points
2392 Posts
Re: How to show advert titles Show Ad "title"
May 08, 2008 08:58 AM|kamii47|LINK
VB version of the code is
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not IsPostBack Then
If YourCondition Then
Page.Header.Title = "Your Title"
End If
End If
End Sub
(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
Member
32 Points
50 Posts
Re: How to show advert titles Show Ad "title"
May 08, 2008 04:28 PM|manorfarm|LINK
Hi
I think it would help if you could expand on the question a little or may be I am missing something
Thanks
Member
48 Points
150 Posts
Re: How to show advert titles Show Ad "title"
May 08, 2008 04:50 PM|roymartian|LINK
Thanks Kamii,
Think I am there now, great help.
Contributor
4232 Points
2392 Posts
Re: How to show advert titles Show Ad "title"
May 09, 2008 02:16 AM|kamii47|LINK
U R Welcome
(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
Member
48 Points
150 Posts
Re: How to show advert titles Show Ad "title"
May 10, 2008 12:27 AM|roymartian|LINK
Kamii,
Copied in your code pretty good except 1 error I cannot understand or fix,
Error 1 Name 'YourCondition' is not declared. C:\Users\The Marsden\Desktop\Fatdog\WEB DESIGN\localstar\localstarMASTER\ShowAd.aspx.vb 73 12 C:\...\localstarMASTER\
Sorry, any ideas?
Thanks,
R.
Member
48 Points
150 Posts
Re: How to show advert titles Show Ad "title"
May 10, 2008 06:39 PM|roymartian|LINK
Ok, been a bit stupid with the "yourcondition" but not sure which condition to use ?
Sorry to be an amateur!
Contributor
4232 Points
2392 Posts
Re: How to show advert titles Show Ad "title"
May 11, 2008 02:18 PM|kamii47|LINK
The check for yourcondition is that for instnace you are checking that there is description available or not you can simply change it to follwoing if there is no condition
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Page.Header.Title = "Your Title";
}
}
(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
Member
48 Points
150 Posts
Re: How to show advert titles Show Ad "title"
May 11, 2008 04:47 PM|roymartian|LINK
Kamii - thanks,
There will always be a description, so this should be ok, as a last help, could you post this in VB ?
Thanks,
Roger.
Contributor
4232 Points
2392 Posts
Re: How to show advert titles Show Ad "title"
May 12, 2008 02:12 AM|kamii47|LINK
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If (Not IsPostBack) Then
Page.Header.Title = "Your Title"
End If
End Sub
(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
Member
48 Points
150 Posts
Re: How to show advert titles Show Ad "title"
May 12, 2008 05:23 AM|roymartian|LINK
Kamii,
Thanks, no error but just get Your Title in page display, changed to Title which is name of database column but no joy.
Sorry to be a pain, I know this is kids stuff for you - any chance of further guidance?
R.
Contributor
4232 Points
2392 Posts
Re: How to show advert titles Show Ad "title"
May 12, 2008 05:24 AM|kamii47|LINK
Post your full code behind code
Also menmtion whihc exact column's Data u want's to show in the Tile
(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])
Member
48 Points
150 Posts
Re: How to show advert titles Show Ad "title"
May 12, 2008 06:06 AM|roymartian|LINK
Kamii,
This is my, ShowAd.aspx.vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) If (Not IsPostBack) ThenPage.Header.Title =
"AdTitleLabel" End IfThis is start of ShowAd.aspx
<%
@ Page Language="VB" MasterPageFile="~/MasterPage.master" CodeFile="ShowAd.aspx.vb" Inherits="ShowAd_aspx" Title="Title" %><%
@ Register TagPrefix="uc1" TagName="CategoryDropDown" Src="Controls/CategoryDropDown.ascx" %> <%@ Register TagPrefix="uc1" TagName="CategoryPath" Src="Controls/CategoryPath.ascx" %><%
@ Import Namespace="AspNet.StarterKits.Classifieds.Web" %>