Web Forms :: Want The AdRotator Control Functionality Where Content Pages On Page Load?
Nov 5, 2010
I want the AdRotator control functionality where content pages on page load but instead of using images I want to use html and other controls like textboxes and buttons. Is this possible?
can one web user control gives two different functionality on two different web pages,suppose i use web user control on web form 1 and also web form 2 , but i want some more work from this control on web form1 but this more work not affect on web form 2. for example: button click event of web user control gives me Good Morning message on screen, when i use this control on web form 1 and web form 2 ,it will give me Good morning message on screen,when i click this button, But i want that ,this control give me Good Morning message and some other messages like good after noon on web form 1 only, one control but different functionalty on two different pages
How do I implement partial page caching with an AdRotator control? I know it's supposed to do it automatically, but I'm using the AdCreated event to handle stats, and this seems to cause the ad to be cached along with the rest of the page.
How to I put this form on my page? The problem is I have a master page which wraps the content pages content in the ASP.net form, I can't nest the forms.
I am embedding a popup extender inside a tab...simple enough - for some reason the content is visible when the page loads - it can be dismissed by selecting the button and then dismissing the popup. Everything works in compatability mode.
I can't tag the panel as visible=false as it is no longer rendered at all.
I'm using this Ajax script [URL] to load content from an aspx page on another server than the page calling the content. So far I've learned that this is a no go. The problem seems to be that when using an absolute link to content the script fails as apposed to using a relative link.
I've searched the web for about 10 hours now, and I still haven't found what I'm looking for.
I have over 300 content pages to create. Each has some standard styling. I would like to generate these pages, and was just wondering if there is a utility in web developer 2008 express to do so (otherwise I will just build one - but it would be great not having to do so!)
I'm making a website that requires ads being repeated down the length of a page with dynamic length. I want the ads to be displayed down the entire length of the page, but I won't know that length until after the data has been displayed. Is there built in functionality for this in .NET? If not, does anyone see any workarounds I could employ to do this for me?
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?)
I have created a matser page with a two radio buttons, text box and a button. Whenever user sets some values to these control and clicks the button, i will navigating him from one content page to another based on the data he has entered. The problem is after the content page load, the values selected/given in the controls(radio button, text box) are getting cleared.
i have encountered a problem on how to load the database images to be display in the Image content in the web pages. I am currently using an Access database with a table "Images" and there are 4 columns in it. "ImageID", "ImageDescription","ImageofPicture","Description". Below is my code: Words highlighted in bold is where the problem occurs. No image is display in the Image box but theres a red cross at the top left. Image description is displaying fine in the textboxes
int MaxRows = 0; int inc = 0; int inc1 = 1; int inc2 = 2; int inc3 = 3; System.Data.OleDb.OleDbConnection cs; System.Data.OleDb.OleDbDataAdapter dta; DataSet ds1; byte[] photo_array; protected void Page_Load(object sender, EventArgs e) { cs = new System.Data.OleDb.OleDbConnection(); //tell the program where the database is located cs.ConnectionString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\Users\Admin\Desktop\Website1\App_Data\Database.mdb"; ds1 = new DataSet(); string sql = "SELECT * From Images ORDER BY ImageDescription ASC"; dta = new System.Data.OleDb.OleDbDataAdapter(sql, cs); cs.Open(); dta.Fill(ds1, "Images"); Navigation(); //MaxRows equals to the total amount of records from the database MaxRows = ds1.Tables["Images"].Rows.Count; } private void Navigation() { //get the first records from the database DataRow dtaRow = ds1.Tables["Images"].Rows[inc]; //get column values in the row TextBox3.Text = dtaRow.ItemArray.GetValue(1).ToString(); TextBox7.Text = dtaRow.ItemArray.GetValue(3).ToString(); DataRow dtaRow1 = ds1.Tables["Images"].Rows[inc1]; TextBox4.Text = dtaRow1.ItemArray.GetValue(1).ToString(); TextBox2.Text = dtaRow1.ItemArray.GetValue(3).ToString(); DataRow dtaRow2 = ds1.Tables["Images"].Rows[inc2]; TextBox5.Text = dtaRow2.ItemArray.GetValue(1).ToString(); TextBox8.Text = dtaRow2.ItemArray.GetValue(3).ToString(); DataRow dtaRow3 = ds1.Tables["Images"].Rows[inc3]; TextBox6.Text = dtaRow3.ItemArray.GetValue(1).ToString(); TextBox9.Text = dtaRow3.ItemArray.GetValue(3).ToString(); //if 3rd column value is not null if (ds1.Tables[0].Rows[inc][2] != System.DBNull.Value) { Image5.ImageUrl = "ImageHandler.ashx?ImageDescription=" + TextBox3.Text; } if (ds1.Tables[0].Rows[inc1][2] != System.DBNull.Value) { Image5.ImageUrl = "ImageHandler.ashx?ImageDescription=" + TextBox4.Text; } if (ds1.Tables[0].Rows[inc2][2] != System.DBNull.Value) { Image5.ImageUrl = "ImageHandler.ashx?ImageDescription=" + TextBox5.Text; } if (ds1.Tables[0].Rows[inc3][2] != System.DBNull.Value) { Image5.ImageUrl = "ImageHandler.ashx?ImageDescription=" + TextBox6.Text; } } } Code for ImageHandler.ashx: using System; using System.Web; using System.Data.OleDb; public class ImageHandler : IHttpHandler { public void ProcessRequest (HttpContext context) { string qry = "SELECT ImageofPicture FROM Images WHERE ImageDescription = ?"; string connect = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\Users\Admin\Desktop\Website1\App_Data\Database.mdb"; using (OleDbConnection conn = new OleDbConnection(connect)) { if (context.Request.QueryString["id"] != null) { OleDbCommand cmd = new OleDbCommand(qry, conn); cmd.Parameters.AddWithValue("", context.Request.QueryString["id"]); conn.Open(); using (OleDbDataReader rdr = cmd.ExecuteReader()) { if (rdr.HasRows) { rdr.Read(); context.Response.ContentType = "image/jpeg"; context.Response.BinaryWrite((byte[])rdr["ImageofPicture"]); } } } } } public bool IsReusable { get { return false; }
I have a master page with a ascx control I use for a header. There is a label in HeaderControl1 I need to set from the content pages. I was able to make the changes in the master template as a tes by just calling the control and accessing the property.
I want to call a javascript method during page load. I am using application.master of the sharepoint server 2007 as the master page . In the content page i want to call a custom method named OnLoadFun() during loading the content page. I have written the function inside script tag in the PlaceHolderAdditionalPageHead id section of the content page.
[Code]....
How do i call the OnLoadFun method so the i is being called onload time. i tried putting window.onload=OnLoadFun surrounded by script tag within the PlaceHolderMain content section.
I have some of the methods in the master page,I want to inherit the master page to content page and use its methods...How will be able to do that..Do we have some techniques with inheritence?Please specify the techniques andPlease in C# with Code Behind...
I am having a slight problem with adding text (output from a stored procedure) to a label control that is nested inside a contentplaceholder (ContentPlaceHolderProductsLeftCol). The page is also using master pages.
Below are excerts of the code - I think I would have to use teh findcontrol property however I am quite lost.
Label name is lastname and is located in ContentPlaceHolderProductsLeftCol
I have 2 nested master pages, lets call them MP1 and MP2. MP1 is top level, MP2 is level
2. Then I have several content pages. Lets say I have 2 content pages for now CP1 and CP2. Each content page has a form that will have some user input and a SaveData()function that saves the data to a database. Each content page also has a "Save" button that calls the SaveData() function.
MP1 and MP2 have several link buttons. The functionality I need is this: Any time a user clicks on a link button in MP1 or MP2, the SaveData() function of the currently loaded page should be called. This is to save the data even if the user forgets to click the "Save" button before leaving the page.
So far I can do this from the link buttons in MP2. I followed the master pages tutorial # 7
In the .cs file for MP2, I declare:
public event EventHandler SaveData;
then i raise a "SaveData" event any time a link button in MP2 is clicked.in every content page (CP1, CP2 etc.) aspx file, I have Master Type directive to assign the Master Page to MP2.
in CP1, CP2 etc .cs file, i have the following code: protected void Page_PreInit(object sender, EventArgs e) { //wire up the SaveData event from MP2 to Master_SaveData function in this page. Master.SaveData += new EventHandler(Master_SaveData); } private void Master_SaveData(object sender, EventArgs e) { //when the MP2 SaveData event is raised, save the data in this page. SaveData(); }
All of this works fine.Problem is I am not able to do a similar thing from MP1.What I have tried so far is to raise an event in MP1 that is handled in MP2. When the event is handled in MP2, it raises the SaveData event to be handled in the page. The event in MP1 is null and hence never raised.
to only DailyLog.aspx , is sufficient for all pages ? because i want to show alert on every page ... Or do i have to insert the above c# code in all the content pages ?
Today I got a strange problem,that is I am unable to access master page controls in its code behind,I am wonder because,I can able to access master page controls in their code behind of other projects/applications's master pages.
I know we can acess like this Label lblText = (Label)this.FindControl("lbluserName"); in that situation but I need to access div controls which are set to run at server.
I create a website with enable default content page. the default content is login page index.aspx. During testing, I found one interesting issue. If I type the URL in browser without specify the page, the site is working fine.
[URL]
If I change the url with specify the default entry page, index.aspx, the login page is working correctly. The problem is, in navigate to another page, I can see one Get index.aspx request send back to server. I don't see this 200 request in the previous test. Why? is that anything wrong?
I have a main master page, say MasterPageMain, and a couple of folders with couple of pages in each folder which act as a child page to that master page - MasterPageMain.
Now, I have about 10 pages in one of the folder which follows a certain pattern and they could really use a nested pages since any change on some parts needs me to change all the pages which is a pain really.
I already added a Nested master page, say NestedMasterPage - which is a child of MasterPageMain
I tried to change one of the page's <%@ Page directive to NestedMasterPage, immediately, there were a lot of errors. plus I dint know where the NestedMasterPage's children content would go.
What do I need to know in order to do this succesfully?
ps: I dint do this initially because I only had 2 pages, and I dint need this at that time, as the project grew, now i see that I should have changed it much earlier..
I have a simple website with a master-page. To set properties to elements on a content page (such as Textbox) I use CSS. In designer it works well but when I launch a site a style isn't apllied to controls. The reason is simple. To say, I have a TextBox with id="TextBox1" in content page, it is placed in ContentPlaceHolder1. In CSS file I set properties for object with id #TextBox1. When I launch a site due to master page name mangling it gets an id like ctl00_ContentPlaceHolder1_TextBox1 which is not defined in CSS file included in masterpage. What is a correct solution of this problem? Hardcoding mangled name doesn't seem to be good.