|
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
|
|
|
|
|
Have you chekced that none of your controls have causevalidation = false
This would be that it would by pass the validation
|
|
|
|
|
Infact what happens is when I try to save my page with invalid data, the page doent gets posk back but also it does not show up the validation message.
This is the issue with it.
Regards,
Vipul Mehta
|
|
|
|
|
Hello Friends!
I've faced a probelm. pls help me.
I am trying to verify whether the path to the webservice hosted in iis is valid by the following code.
HostingEnvironment.VirtualPathProvider.FileExists("http://localhost/WSClientProxy/teste.asmx");
But every time it displays "'http://localhost/WSClientProxy/teste.asmx' is not a valid virtual path."
How can I get the virtual path?
Thanks!
modified on Tuesday, April 8, 2008 12:25 AM
|
|
|
|
|
Hi, Samrat.
The problem is that you're trying to use a file system routine (FileExists) with the virtual web url path that the browser uses. As you might suspect, these are completely different things.
MapPath() (I think it's in the Server namespace) will take a virtual path like "~/WSClientProxy/teste.asmx" and give you back a physical path to the filesystem. For example, MapPath("~/WSClientProxy") will give you the physical directory pointed to by this virtual path. You can then use that directory to create files, etc. and of course you can use MapPath("~/WSClientProxy/teste.asmx") as the parameter to FileExists(). If you play around with it and do some tests with creating, renaming (MoveTo()) deleting files, etc., I think you'll get the hang of it.
Hope this helps!
|
|
|
|
|
hi friend
i am using .net2008 on vista whree i sendind SMTP mail but error is produce :- Cannot get IIS pickup directory
when i see in intupub then there is no any mailroot folder so how i can solved this problem please help me.
Thanks
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Looks like SMTP server is not installed on your machine. Check that in the IIS settings.
|
|
|
|
|
Ok
i am using VB.net 2008 on vista there i alredy instaled IIS(all components) but there is no any mailroot folder in intupub then how i can instal SMTP Server in Windows Component in vista.
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|