|
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 )
|
|
|
|
|
No my Save button is not using any AJAX logic. Whats "hte script" u are talking about?
I even tried using ValidationGroup on all validators but that too didnt worked out as expected.
Is there any page level setting that needs to be done?
Regards,
Vipul Mehta
|
|
|
|
|
You said that when you postback it validates. Do you mean it posts back and validates on the server side only ? I am trying to work out your situation from what you said. Does your button do a postback and the validators don't work ?
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 )
|
|
|
|
|
Yes absolutely correct. On click of "Save" button the server side logic saves the data in to database. But before that if the data input is wrong than it should validate the controls first.
Am I correct?
Regards,
Vipul Mehta
|
|
|
|
|
Yes. Not sure why that would not be the case. You can add a custom validator and use firebug/firefox to confirm they are firing.
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 )
|
|
|
|
|
Yes the validators should run before any data is sent to the server, im pretty sure on this, is it possible to post all your code, or is it too much
cheers
|
|
|
|
|
Then its a weird behavior....
I guess I need to dig dip in to it
Is there any page level settings for validators?
Regards,
Vipul Mehta
|
|
|
|