|
Thanks for providing the code.
I am trying to compile the code you have provided.
It is giving me error
'MasterPageCP.PageBackgound.get' must declare a body because it is not marked abstract or extern
Please help
Sujoy Upadhyay
|
|
|
|
|
Code is valid - it should work fine. Go in to the property pages of your project and make sure that the "Target Framework" is .NET 3.0 or 3.5.
|
|
|
|
|
This wont work for .Net 2.0?
Sujoy Upadhyay
|
|
|
|
|
In 2.0 , you need some changes in property declaration
private string _background;
public String PageBackgound {
get { return _background; }
set { _background = value; }
}
|
|
|
|
|
Steve Holdorf wrote: set it's back ground color in the body tag . Now that is fine for the Master page
change style tag with class, because it to difficult to override style tag from content page
for example in masterpage
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style>
.bodyClass
{background-color:Red;}
.conetntpage
{background-color:White;}
</style>
</head>
<body class="bodyClass";>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
now in content Page PageLoad
public partial class contentpage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script language=\"javascript\">");
sb.Append("document.body.className=\"conetntpage\";");
sb.Append("</script>");
ClientScript.RegisterStartupScript(this.GetType(), "MyScript", sb.ToString());
}
}
Hop this will help you
Raju.M
|
|
|
|
|
Everything above looks great; however, someone indicated that all I have to do is set a style background-color in the content page to a different color. If this is true in which content page tag do I set the background-color style?
Thanks,
Steve Holdorf
|
|
|
|
|
Got it working. Just did this:
Add this in the master page head
<asp:contentplaceholder id="head" runat="server">
<asp:contentplaceholder id="head" runat="server">
Set some background color to whatever control you want, either div or table etc in the master page.
Then in content page, you can set the style in its head,
If you do not have any head section in the master page and insert style in content page, you will get an error
content page will look like this:
view plaincopy to clipboardprint?
<asp:content id="Content1" contentplaceholderid="head" runat="server">
body,html
{
background-color: White;
}
Thanks for all of you guys helping me.
Steve Holdorf
|
|
|
|
|
I am loading dropdown list using c#. I need to load data from dropdown into Listbox using javascript.
|
|
|
|
|
var obj = document.getElementById('<%=YourDropDown.ClientID %>');
var obj2 = document.getElementById('<%=YourListBox.ClientID %>');
for (i=0;i<obj.options.length;i++)
{
obj2.options[i] = new Option(obj[i].text, obj[i].value);
}
|
|
|
|
|
Thanks Gray, I too came to know about this. only thing bothers me is if drop down contains more than 100 records how is the performance?
|
|
|
|
|
The solution is quite good. I dont think performance will be a issue since all operations are on client side.
What say Gray?
Sujoy Upadhyay
|
|
|
|
|
It will definitely affect performance. See this [Faster DHTML in 12 Steps]
Taken from MSDN
Tip: Use innerHTML to add a large number of options to a SELECT element.
Use string concatenation to build up the SELECT element HTML text, then use this to set the innerHTML property. For very large numbers of options, string concatenation can also affect performance. In this situation, build an array and call the Microsoft JScript join method to perform a final concatenation of the OPTION element HTML text.
|
|
|
|
|
I say you shouldn't do it client side at all. You should do it on the server side. I say there are very few reason why you should ever need to UI elements with the exact same data in them. I also say that a dropdown with 100 items in it is not good interface design. You need to figure out some way to break it down or a different UI element to use. But I don't have enough info to give solutions to those issues.
|
|
|
|
|
Hello all,
I have to make a project to keep track of the systems currently in the Network in asp.net.
In other words, I want to have an application in which there must be a check about how many connections are currently in use and which are those connections ( e.g. using their IDs)...
And apart from this, If anyone gets Offline, then his/her status must be triggered as mail to me...so in this way, I can manage the computer Network Connections..
Anyone knows where can I get the sample project for this ...or get simple idea ...?
Thanks in advance..
|
|
|
|
|
I think you must be assigned in college or school to do such exercise.
But my dear friend, this is not code providing forum.
We are here to help you, if you were stuck at some point whether in logic
or technically.
See what I have found by little googling[^].
Also, please go through the forum guidelines[^] before you post anything.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
|
thanks for sending..
but How could u say like that...?
|
|
|
|
|
What kind of connections are you talking about? Are you talking about current HTTP connections to the web server? Are you talking about machines connected physically to the network? Are you talking about users logged in to the windows network? Read up on the OSI model and once you understand the many different levels of connection you can ask a more answerable question.
|
|
|
|
|
Hi friends,
Please help me as i m very confused
as per my knowledge static variable always reamin same for all users but recently i joind one compny where i found that they have taken one static class with static members and stored that static class in session
[Here Authentication is form authentication]
& Now as per website reviews and results till now there is no issue with static class and members so pls do the needful help.
Please let me know should i hav to remove static class storing in session or i should continue with that solution .
pleasee tell meee
Reasons are not Important but Results are Important.
http://www.sql4professional.blogspot.com
Swati Tripathi
|
|
|
|
|
It is not necessary to remove static class.
The important thing is what values are stored
in static class?
We can decide from the values stored inside the
static class, that whether we can keep it or remove it.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi,
I have added reference to AjaxControlToolkit.dll
but ahax controls are not working in my website.
this is my code
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<aspx:FilteredTextBoxExtender ID="ftbe" runat="server"
TargetControlID="TextBox1"
FilterType="Custom, Numbers"
ValidChars="+-=/*()." />
<aspx:CalendarExtender ID="asd" runat="server" TargetControlID="TextBox1" PopupButtonID="Button1" ></aspx:CalendarExtender>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</div>
|
|
|
|
|
Your code is working fine in my machine. Please check the AjaxControlToolKit.dll reference. Also check whether the toolkit reference has been added in your aspx page or not.
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="aspx" %>
|
|
|
|
|
What do the register statements look like? Using aspx as a control prefix is a little odd. How did you create the project? If you didn't create it using the ajax enabled template your web.config may not have everything you need for system.web.extensions.
|
|
|
|
|
Please suggest a validation for calendar extender in ajax for web application..I have to validate for fromdate and todate
|
|
|
|
|
Use RangeValidator to validate date ranges
Here is an [example]
|
|
|
|