I have been given by a designer the HTML show below. This is a menu which will be used in throughout our website in a master page. My worry is how can I handle de the different class used depending when the page is selected or not. Below when on the page the id is "bot_seleccionado" and when a page is not selected it is bot1.
I have a code behind file which has only a few placeholders and literal. The gridview control and others are added in real time according to program conditions. I noticed that once in a while th eprogram stopped working because the .aspx file is changed and some of the place holders disappeared - Why? (the bolded lines disappeared once in a while)
We have recently bought a website that was programed in .asp. Every website page has a line of code that allows it to use the Meta title tag found in the 'Maincontent.master' file. This sample is taken for the about us page;
I want to each page to have its own unique title tag, however I am struggling to implement this. I have tried removing the above line and replacing it with a standard title tag line i.e. <title>About us</title> but when I do this it kills the page completely. how I could replace the above with a unique title tag, or is it not that simple? Descriptions and keywords are not a problem as they are already individually setup; it's just the page title
I am using Visual Studio 2008, .NET version 3.5, and coding in C#.In my masterpage, I have a div: <div runat="server" id="divMasthead" class="top-img">
In the code behind of that masterpage, I am trying to randomize which background image displays for this div on page load.When I run my project, the div has no background image.After opening the site and viewing the page source, the html output is:
I have a site map on my project and I have section which get values from sql database and it changes according to querystring Id value. In my sitemap the title of the page is everytime same. but I want tpo change it at runtime. I am using multiple sitemaps and My sitemap is not the default one. its name is rootSitemap. I tried some code which I got from msdn but it seems doesn't work for me;
[Code]....
Here is my sitemappath code which is situated in my master page;
I have a asp.net page - manageCustomer.aspx with a button 'SyncCustomers'. When this button is clicked, customer records will be taken one by one from one database and syncd with another database. As it is a long running process, when this button is clicked and process starts, I want to show present status in a label box of the same manageCustomer.aspx page. But inside this button click event, where I have codings for this process, when I try to update text of label box, its not changing in that page. only when all process were completed,last text that i gave for label box is displayed. So, How to give updates of running process in a label?
In my asp.net application i'm using gridview to which i'm binding data dynamically by writing a select query in code behined file (all column's are autogenerated) now i want to change gridview cell to edit mode from label to textbox or dropdown on clicking of gridview's cell.How can i achive this in code behined file.
I have a application, and I want to log exceptions to a file and I don't want to change any code. I just want a component to which I can add my code and it will start logging exceptions. How can I do this?
On the MSDN page for the Membership.ApplicationName property (which applies to an asp.net membership provider), it warns that although one can change Membership.ApplicationName in code, 'The ApplicationName property is not thread safe for multiple writes, and changing the ApplicationName property value can result in unexpected behavior for multiple users of an application.' They therefore recommend avoiding using it for a 'web application'.
This is because the default SqlMembershipProvider is written as a singleton. But here's my question: is it OK if all the threads in my application process are going to set Membership.ApplicationName to the same thing?
I'm thinking of having multiple applications on my IIS box, each with their own separate application pool. I want to point them to the same location, but based on the hostname, set the application provider to different things. Wouldn't this actually be OK? It might not be a thread-safe operation, but doesn't each application pool have its own process and therefore its own instance of SqlMembershipProvider? So, every thread that tried to set Membership.ApplicationName for a given SqlMembershipProvider instance would be trying to set it to the same thing (the provider that is appropriate for that hostname).
What I need to do is perform some kind of decision statement and when true I need to change the backcolor of a treenode to grey, so that it has a grey box around the whole text. There is no backcolor property for the tree node and I don't need it applied all the time so I don't think a CSS class will do this.
Where that comment in the code-behind file says "REFERENCE IN CODE HERE", that is where I want to set the value of the "remLen3" input (client-side control) to "30 characters left."I obviously left out irrelevant things like inserting the txtNewComment.Text into the database. But what's going on here is when the user types in something into the txtNewComment text box, I'm using javascript to change the value of the remLen3 control.My problem is that when I submit the text from the txtNewComment textbox to the database and set the txtNewComment.Text equal to Nothing, I don't know how to reset the remLen3 field value back to saying "30 characters left.". I already tried to add a "runat="server"tag to it, but when typing stuff into my txtNewComment textbox it gives me an error. I already tried to figure out what the error meant, so I'm not going to spend time trying to solve it anymore; I would rather just see if there is a workaround to using the runat="server" tag. Maybe do some kind of a CType(FETCH_REM_LEM3_HERE_SOMEHOW, INPUT_TEXT_TYPE??).value = "30 characters left". If there is a way of converting the input text control (remLen3) that way, then how would that be done? I just want to change the value of that field when the server-side button is pushed.
gaining mode changing for formview in VB.The problem is that, the current mode im using was ReadOnly, and i want to add some button so thatit could connect to Edit mode in the same formview.Is it necessary to add modechanging and modechanged in the back code?
I have a details view in asp.net which I am dynamically replacing some of the controls using code behind (e.g. converting some text boxes to dropdowns). My problem is that I am unsure how to bind these to the field from the database on postback. I.e. I am trying to find the code behind equivalent bind('currency');
I can populate the dropdown with the current value from the database but cannot find how to save a new value on updating the detailsview.
I've been trying to follow the directions on the NHProf site but can't seem to make it work. What am I missing?I put a log4net configuration section in my web.config:
The problem is when am assigning my session table value to newly created table and if now am changing any coloumn name then the session table value also changing.
But my question is am assigning Session value to newly created table so how should session value should be affected?
I have a 'classic' ASP.NET app (.NET 3.5) with a pretty standard runat="server" style form with server-side controls and an 'Execute' asp:button. In the code-behind, the executeButton_click handler processes some of the other controls, runs a report, and drops the result into an asp:label. So the effect of pressing the Execute button is that the entire page reloads with the report inserted into the label.
I need to change this so that when the Execute button is pressed, the report pops up in a new window with a different layout (ie without the controls and form). If I was doing this in an MVC framework I would just change the view template in the 'execute' action, so the analogue for ASP.NET would be change the code in front, ie the .aspx file that gets used, from the code-behind class.
Is this possible? I know the link between the .aspx and the .aspx.cs isn't extremely tight as it is possible to reuse a code-behind class in multiple .aspx files. So can I set the .aspx file to render from the code-behind?
have two drop down list in my page. When i select one drop down, the value of second drop will change according to the value of first drop down. I don't want page refresh when i select my first drop down. So i use update panel but now when i select the value from my first drop down on the event of selectedindexchanged it will always shows me the default value and if i remove update panel it works perfectly but with page refresh. I don't know what is the problem. Values for both drop down is coming from database. Also i have done !IsPostBack in my page load but i don't know where is the problem..Please check the code below:
I have a webform with difrent parts in it, its like a search criteria, noissues with other parts but theres one part in it called guest profile which is giving me problems.There was a field name called guest company with a textbox by its side, when the user enters the company name and clicks enter it displays the list of people with that company name
but now I have changed this textbox to ddl and populated this ddl with the company names now when I am selecting this company name and clicking enter its not showing the data the code for the above issue is shown below I have also posted the stored procedure used in this
the code used to design the DDL
<tr> <th> Guests Company: </th> <td> <asp:DropDownList ID="ddlCompanyName" runat="server" CssClass="default" /> </td> </tr> the code used to bind the data to this ddl protected void BindCompanyDDL() { var companyList = Company.FindAll(); ddlCompanyName.Items.Add(new ListItem("- Select Company -", "")); foreach (var companyDetail in companyList) { ddlCompanyName.Items.Add(new ListItem(companyDetail.Name, companyDetail.Id.ToString())); } ddlCompanyName.DataBind(); } the code used to initialize search public void InitializeSearch(ref RecipientSearchParams searchParams) { if (!String.IsNullOrEmpty(txtGuestName.Text)) searchParams.GuestName = HttpContext.Current.Server.HtmlEncode(txtGuestName.Text); if (ddlCompanyName.SelectedValue != String.Empty) searchParams.CompanyName = ddlCompanyName.SelectedValue; if (ddlCompanyType.SelectedValue != String.Empty) searchParams.CompanyType = ddlCompanyType.SelectedValue;
the code used to load parameter values
public void LoadParamValues(RecipientSearchParams searchParams) { if (!String.IsNullOrEmpty(searchParams.GuestName)) txtGuestName.Text = searchParams.GuestName; if (!String.IsNullOrEmpty(searchParams.CompanyName)) ddlCompanyName.SelectedValue = searchParams.CompanyName; if (!String.IsNullOrEmpty(searchParams.CompanyType)) ddlCompanyType.SelectedValue = searchParams.CompanyType; public interface IAudenceTab { bool ValidateSearch(); void InitializeSearch(ref RecipientSearchParams searchParams); void LoadParamValues(RecipientSearchParams searchParams); } private void PopulateGuestSqlParams() { if (!String.IsNullOrEmpty(GuestName)) { AddHashValue("GuestName", _GuestName); Description += String.Format("Guest Name {0}; ", _GuestName); } if (!String.IsNullOrEmpty(CompanyName)) { AddHashValue("CompanyName", CompanyName); Description += String.Format("Company Name {0}; ", CompanyName); } if (!String.IsNullOrEmpty(CompanyType)) { AddHashValue("CompanyType", CompanyType); Description += String.Format("Company Type {0}; ", CompanyType); } public List<Person> ExecuteSearch() { PopulateSqlParams(); MSSqlDBProvider db = new MSSqlDBProvider(); SqlConnection conn = db.GetConnection(); List<Person> pList = DataObjectProvider<Person>.GetObjectList("dbo.PersonNewsletterFilterSearch", CommandType.StoredProcedure, pHash, conn); return pList; } stored procedure used (@GuestName IS NULL OR p.FullName LIKE '%' + @GuestName + '%') AND (@CompanyName IS NULL OR p.ID IN ( SELECT Distinct compGuest.GuestId From CompanyGuest compGuest Inner Join CompanyDetail compDetail on compGuest.CompanyId = compDetail.PersonId where compDetail.[Name] = @CompanyName )) AND (@CompanyType IS NULL OR p.ID IN ( SELECT Distinct compGuest.GuestId From CompanyGuest compGuest Inner Join CompanyDetail compDetail on compGuest.CompanyId = compDetail.PersonId where compDetail.[Type] = @CompanyType)) AND
I am now in process doing theme for my web application.
This is how i want my Theme work :Whenever user choose to change the theme, the whole web site theme should changed accrodingly.
Most of the examples that i find out online require to assign the theme in Page_PreInit event in every page. The theme name is store in session variable.
My concern is that is there anyway to assign particular theme to whole web site without having assing it to every page and store the theme into session variable.