|
if one needs to change the value in HTML (as he is asking) one can use javascript and search for the the particular TAG (<title> in this case) ans set its innerTEXT / innerHTML as per requiremnet.
try to use javascript ... it is bit easier solution for your problem without implementing anycode in CODE BEHIND
cheers !
<div class="ForumSig">Ashish Sehajpal
</div>
|
|
|
|
|
No, you're wrong. Doing stuff in code behind is elegant, allows for object orientation, and works on any browser. Doing stuff in javascript requires that you know for sure that only certain browsers are going to be used, and increases the load on your traffic, because the pages are bigger. It also means you can't comment your code unless you want to also send the comments to the client.
Indeed, because he wants to set his header based on server side events, doing it with javascript would require injecting javascript into the page in the code behind, which would just make this approach doubly retarded.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thank you so much for your replay.i use find and replace.so thank you...
|
|
|
|
|
Hi, I am stuck big time with a problem in Data Grid.
I am using C#, in VS.NET 2003.
I am writing a simple web mail system, and I am using the datagrid to display the inbox.
It is a very standard inbox, nothing fancy, and I am displaying the sender, subject, as well as the date sent. For each message there is an extra column "opened" which denotes whether the message has been read.
Here's what I am stuck, I need to BOLD the message subject for those messages which are unread.
I have absolutely no idea where to place the codes, the pseudocode is very simple, simply:
If the "opened" column for that particular message is NO,
then BOLD the subject
Where do I place the codes? I tried to place it in the HTML code as well as the codebehind, no luck.
Any suggestions??? HELP!!!
Thanks!!!
|
|
|
|
|
First suggestion, post your code so we can point out what you're doing wrong.
I would do something like writing a div to contain the text, and then having the style set the font weight via a property that comes from the codebehind, which in turn is passed the opened value, and returns the right string for plain or bold text.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for the reply.
Here is the code for the part that displays the Template Column.
<br />
<asp:TemplateColumn HeaderText="Subject" ItemStyle-CssClass="content"><br />
<HeaderStyle CssClass="subtitle"></HeaderStyle><br />
<ItemStyle Width="350px"></ItemStyle><br />
<ItemTemplate><br />
<asp:HyperLink id="Viewmessage" runat=server CssClass="content" NavigateUrl='<%#"viewmessage.aspx?messageid=" + DataBinder.Eval(Container.DataItem,"messageid") %>'><br />
<font class="content"><br />
<%# DataBinder.Eval(Container.DataItem,"messagesubject") %><br />
</font><br />
</asp:HyperLink><br />
</ItemTemplate><br />
</asp:TemplateColumn><br />
As you can see, the code above only retreives the SUBJECT and displays it.
Is it possible to put a IF condition in the HTML Code? It is possible to do something like this?
<br />
<asp:TemplateColumn HeaderText="Subject" ItemStyle-CssClass="content"><br />
<HeaderStyle CssClass="subtitle"></HeaderStyle><br />
<ItemStyle Width="350px"></ItemStyle><br />
<ItemTemplate><br />
<asp:HyperLink id="Viewmessage" runat=server CssClass="content" NavigateUrl='<%#"viewmessage.aspx?messageid=" + DataBinder.Eval(Container.DataItem,"messageid") %>'><br />
<br />
<%#<br />
if (DataBinder.Eval(Container.DataItem,"opened") == "no")<br />
{<br />
SET FONT = BOLD<br />
}<br />
%><br />
<br />
<font class="content"><br />
<%# DataBinder.Eval(Container.DataItem,"messagesubject") %><br />
</font><br />
</asp:HyperLink><br />
</ItemTemplate><br />
</asp:TemplateColumn><br />
Thanks!!!
|
|
|
|
|
You can do this:
]]>
// add tags for column here
]]>
I may have some details wrong here, but I know I've done a control that added columns to a datagrid in certain modes using code similar to this.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
why don't you do this from code behind...it is bit easier from there.......
Ashish Sehajpal
|
|
|
|
|
Hi Friends,
I have one Com Dll to hash the password.
How to use that DLL in ASP.net to hash the password.
Thanks
Hari
|
|
|
|
|
Import it into your project the same way you would any COM dll and call it in your business layer.
Of course, it makes more sense to use the crypto stuff built into .NET
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Asalaam Alakum,
I am finding list of controls from another aspx page within a project, for this purpose i am tring reflection. If reflection is appropriate solution please give me code else tell me another solution.
Thanks alot
Regards Syed Kamran ul Haq
ALLAH HAFIZ
|
|
|
|
|
There's not really any way for one page to examine another page, because the only page that exists in your project at runtime is the page currently being generated. What do you need this for ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
IF your using user controls it isn't an issue simply expose the user control and the controls on that page you wish to access via public properties
A pessimist sees the difficulty in every opportunity; an optimist sees the opportunity in every difficulty I am a Optimist
|
|
|
|
|
I would assume if he wants to enumerate controls on a page, he's actually hoping for their state to be maintained, and to get their previous values.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
just like we give form level security to users in our application, i am developing a form which will get the list of controls of a aspx page (page will be selected from ddl) and give rights (visible,enable etc) to them and save in database.
thanks for answering.
Regards Syed Kamran ul Haq
ALLAH HAFIZ
|
|
|
|
|
OK, then string mashing is probably your best bet, just look for asp: and an ID attribute to get the type and name of controls.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i am devlopping a asp.net application in (VS 2005).
wheren in my default.aspx page there is a provision for login and that
login control is resides with in "frame". Now when i login sucessfully it
redirects to a new default2.aspx page. My problem is that after login
2pages are there in the window . i want to close the "default1.aspx " when
default2.aspx is loaded in the window.
how can i do in the server side.
to open a new defaul2.aspx page in a new window i have written the follwing code.
<br />
System.Text.StringBuilder sb = new System.Text.StringBuilder();<br />
sb.Append("<script language='javascript'>");<br />
sb.Append("window.open('Boundry/ScrUserHome.aspx', 'PopUp',");<br />
sb.Append("'top=0, left=0, width='+screen.availwidth+', height='+screen.availheight+', menubar=no,scrollbar=yes,toolbar=no,resizable=yes,addressbar=no');<");<br />
sb.Append("/script>");<br />
Type t = this.GetType();<br />
<br />
if (!ClientScript.IsClientScriptBlockRegistered(t, "PopupScript"))<br />
ClientScript.RegisterClientScriptBlock(t, "PopupScript", sb.ToString());<br />
<br />
now how to close default1.aspx page in the server side????
|
|
|
|
|
You'd do better to stick to the one page, but you can use window.close() to close the current window. The user will be asked if they want to close it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
there is no point of opening a newer window if you need to close existing one ? atleast the web architecture doesn't allow such flows.
try to change the current page with the newer page in same browser window...
Ashish Sehajpal
|
|
|
|
|
using locking concept
how an app.config connection string tag or we.config file connection string tag can be locked.
|
|
|
|
|
What do you mean by that ?
|
|
|
|
|
sir i saw in one article that configuration sections can be locked so that they cannot be overrideen .so i need how a connection string is locked...am i going wrong sir...?
|
|
|
|
|
This sounds pointless to me. The only way to override a config setting is to put a web.config file with a different setting in a subfolder. Just don't add config files to subfolders.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I am facing certain issues with ASP.NET validator control (to be specific RangeFieldValidator - RFV & CustomFieldValidator CFV)
I have implemented RFV on a text box which checks that the value entered in the text box should not be less that 0 & the CFV check if the selected value on a particular drop down (ddlChannel) is either "A" OR "B" the value must be selected in another drop down (ddlLocation) related to that drop
But when my page gets loaded for the first time & I click the "Save" button, these validators dont get triggered & then if there is any post pack on that page the validators start working as expected.
Below is my RFV & CFV logic:
RFV Logic
========
<asp:RangeValidator ID="vldMarginRange" ControlToValidate="txtMargin"
Type="Integer" MinimumValue="1" MaximumValue="99" Enabled="True" runat="server">* You must enter a whole number between 1 and 99</asp:RangeValidator>
CFV Logic
========
<asp:CustomValidator id="CustomValidator1" runat="server" ControlToValidate="ddlWBSLocation"
CssClass="ms-descriptiontext" ClientValidationFunction="CheckWBSLocation"
Display="Dynamic">
* You must select a Location for the Contract Template "A" or "B"
</asp:CustomValidator>
function CheckWBSLocation(source, arguments)
{
var channel = document.forms[0].elements.<%= ddlChannel.ClientID %>;
var WBSLocation = document.forms[0].elements.<%= ddlWBSLocation.ClientID %>;
if(channel.value == 'A' || channel.value == 'B')
{
if (WBSLocation.selectedIndex == 0)
{
arguments.IsValid = false;
return;
}
}
arguments.IsValid = true;
}
Is there setting that I might be missing?
Regards,
Vipul Mehta
|
|
|
|
|
What save button ? Validators work on attempted postback, is your save button using AJAX or something ?
You can look at hte script generated for validators and write your own code to call them, that's how I did it when I wrote pages using validators and posting data with AJAX
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|