|
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
|
|
|
|
|
Ohh I think VISTA won't come with SMTP server. Check this[^]
|
|
|
|
|
I've been working with ASP .NET and data for a couple months now. I'm creating a web app that is more or less a "virtual worksheet" with multiple choice questions. I get the question text and four answers from an Access database. Using data from an invisible GridView, I create Labels and RadioButtonLists at runtime and add them inside a View in my MultiView.
For I As Integer = 0 To Me.gvQMultipleChoice.Rows.Count - 1<br />
Dim lbl As New Label<br />
lbl.ID = "lblQ" & I<br />
lbl.Text = I + 1 & ". " & Me.gvQMultipleChoice.Rows(I).Cells(0).Text<br />
Me.vw1.Controls.AddAt(Me.vw1.Controls.Count - 5, lbl)<br />
Dim rad As New RadioButtonList<br />
rad.ID = "rad" & I<br />
For I2 As Integer = 0 To 3<br />
rad.Items.Add(SwitchChar(I2) & ". " & Me.gvQMultipleChoice.Rows(I).Cells(I2 + 1).Text)<br />
Next<br />
rad.RepeatDirection = RepeatDirection.Horizontal<br />
Me.vw1.Controls.AddAt(Me.vw1.Controls.Count - 5, rad)<br />
Next
Basically, make a Label, get its question text, add it to the View. Same with the RadioButtonList. This works fine. My problem is later, when I am trying to find out which RadioButton is selected. Me.vw1.Controls doesn't contain any of these Labels or RadioButtonLists.
<br />
Dim myControls As ControlCollection = Me.vw1.Controls<br />
For I As Integer = 0 To myControls.Count - 1<br />
If myControls(I).ID <> Nothing Then<br />
If myControls(I).ID.StartsWith("rad") Then<br />
Dim rad As RadioButtonList = Me.vw1.Controls(I)<br />
ans &= rad.SelectedIndex<br />
Else<br />
'ignore<br />
End If<br />
End If<br />
Next
This should work fine, I'm confident it would. But again, the problem is that the dynamically created controls aren't in the list. Does anyone know why it would be like this.
By the way, the Labels and RadioButtonLists show up, and I can select a RadioButton. The second bit of code is executed on a Button.Click event.
Thanks!
(Yes, this also in the Web Dev section. Sorry I posted there first.)
Evan Stoner
Breeze Innovations
|
|
|
|
|
When do you add the controls ? If you add them in the prerender event, then the issue is that the click event fires first.
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 )
|
|
|
|
|
The controls are added in the View.Activate event. Yes, the same view that contains the dynamically-added controls and the Button that is clicked.
Evan Stoner
Breeze Innovations
|
|
|
|
|
OK, I'm not familiar with that event, I'd set breakpoints to see if it's called after you search for the controls or not.
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 )
|
|
|
|
|
It's just the event that fires when the MultiView's ActiveViewIndex property is changed and the View begins to load.
Evan Stoner
Breeze Innovations
|
|
|
|
|
How to Resize a pop-up according to it's content height and width...
I've got a popup on my application and it's content is dynamic I mean sometimes it needs to be big or small according to it's content so how can i get over it...
thanks..
I found some code but it's for pictures but i want it to make the same effect according to a div or another control...
The code i found :
<title>Image
function resize() {
window.resizeTo(document.image.width+12, document.image.height+82);
}
I am not a perfect programmer,but i have perfect's programmers' habits.
|
|
|
|