|
All the validators support the client side validation, expcept that you are using the ASP.NET 1.1 with non-Microsoft browsers.
By the way, can you write your reply in full instead of using the SMS style.
|
|
|
|
|
thks for taking interest
i wnt to validate my dropdwn list through javascript
i hv grid and in the grid i hv Dropdownlist ,the dropdownlist
is populated through database.,i wnt to apply Validation on the
dropdown ,either the user select the value or not...danish bahi in
servr side i down it ..bt i wnt to do in client side,,or tell
the function name that Count the Number of Dropdwnlist Control on
the webpage under the datagrid..
this is my whole code
"asp:DropDownList id=DropDownList1 onChange="JavaScript:get_selected(this);" Width="150" Runat="server" AutoPostBack="false" DataSource="<%#load_()%>" DataTextField="GradeDescription" DataValueField="GradeDescription">
"/asp:DropDownList>
and this is my javascript function
"
function get_selected()
{
var theContent=document.getElementById("DropDownList1").sourceIndex;
//var theContent=document.getElementById["DropDownList1"]
if (theContent="[SELECT ONE]")
{
window.alert("Select all the value from the dropdownList");
}
}
"
plz help me hw can i validate this on the cleint side
waiting for ur rply
-- modified at 3:19 Thursday 22nd June, 2006
|
|
|
|
|
Hi,
I have a good amount of mail templates from which i just read the contents and send it as a mail, and all the templates are written in .TXT file.
Now i want to do the same thing in a different manner that is , i want to read the same .TXT file and append the logged in user name somewhere in the file.
I have completed the base of how to send the mail but i am stuck up of how to modify the contents dynamically.
I dont want to save the modified file, i just want the name to be included.
I wish if something can be done in StreamReader when i read the contents in this object.
Thanks in advance.
Deepak Surana
|
|
|
|
|
+ You can place a special text holder like <LoggedInUserName> , you then simply replace it with the real username value.
+ You can place the format item like {0} ... in the contents, and use the String.Format method to insert the username value.
|
|
|
|
|
hi,
thanks for the reply, i am sure both the methods are beneficial.
but can you please tell me how to use String.Format, and which one is more convenient to use.
|
|
|
|
|
String.Format[^]
deepaks3 wrote: which one is more convenient to use.
Not sure, but I'd go for this method.
|
|
|
|
|
hi all,
i have a daily user table contains user name,price of product etc.
i have to place each and every user information in the data grid along with a
check box infront of the user name.
can any one help me how to generate check boxes dynamically.
thanx in advance....
your
peter
|
|
|
|
|
You can use checkboxlist control to generate the checkboxes dynamically. you can assign source to the checkboxlist control and bind that to make it ready for use.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi there,
Are you sure that you need dynamic checkbox controls? Anyway, you can find lots of datagrid examples from the datagridgirl[^] site
|
|
|
|
|
Hi,
I am using dataview.sort property to sort my datagrid by date column.
following is the syntex i am using.
dataview.sort=dataset.tables[index].columns["columnname"].tostring();
this sorts my datagrid in ascending order.i want to sort in descending order.
it looks very easy, i tried diff. syntex, but not working out.
please help me if any body can.
Thanks,
Nikki
-- modified at 17:30 Thursday 22nd June, 2006
|
|
|
|
|
|
I can't able to find the syntex for DESC order which fits in my problem. I am using following syntex. but where should & how should i include the key word DESC in my coding line.Thanks,
dataview.sort=dataset.tables[index].columns["columnname"].tostring();
Nikki
|
|
|
|
|
You simply concatenate the DESC keyword after the column name:
dataview.sort=dataset.tables[index].columns["columnname"].tostring() + " DESC";
|
|
|
|
|
When I concatenate the DESC keyword after the column name, It's not returning any value to Datagrid. I tried the same syntex.
Thanks,
NIKI
|
|
|
|
|
i dont know why tis application wont works...
it keep giving me the first records in the database and populate it twice, when i wanted both 2 different records to appear...
if possible help me debug this or give me some comments...
thanks in advance...
Dim aryTest(2) as integer
arytest(0) = 1
arytest(1) = 2
Dim objAdapter As New SqlDataAdapter
Dim objDs As New DataSet
Dim ojDataRow As DataRow
Dim objArrayList As New ArrayList
objCMDB = New cCMDB
Dim i As Integer
For i = 0 To 1
mobjcmd.CommandText = "SELECT Contract_Ref,Equipment_Status, " & _
"Technology_Refresh_Eligibility, Configuration_Item_Description, " & _
"Configuration_Type, Maintenance_Contract, Procurement_Vendor, " & _
"Warrenty_Ends, Warrenty_Period FROM tblCMDB WHERE" & _
"Configuration_Item_ID = "& aryTest(i) & ""
mobjcmd.SelectCommand = mobjcmd
objAdaptor.Fill(objDs, "tblcCMDBRecords")
objDataRow = objDs.Tables("tblcCMDBRecords").Rows(0)
objcCMDB.ContractReference = objDataRow.Item("Contract_Ref")
objcCMDB.EquipmentStatus = objDataRow.Item("Equipment_Status")
objcCMDB.TechnologyRefreshEligibility = objDataRow.Item
("Technology_Refresh_Eligibility")
objcCMDB.ConfigurationItemDescription = objDataRow.Item
("Configuration_Item_Description")
objcCMDB.ConfigurationType = objDataRow.Item("Configuration_Type")
objcCMDB.MaintenanceContract = objDataRow.Item("Maintenance_Contract")
objcCMDB.ProcurementVendor = objDataRow.Item("Procurement_Vendor")
objcCMDB.WarrentyEnds = objDataRow.Item("Warrenty_Ends")
objcCMDB.WarrentyPeriod = objDataRow.Item("Warrenty_Period")
objArrayList.Add(objcCMDB)
Next
MobjCn.Close()
Return objArrayList
i@@
|
|
|
|
|
You need to recreate the new objcCMDB object in the for loop statement, otherwise it will overrite the current object.
|
|
|
|
|
thx dude thx for ur help... u save me...
|
|
|
|
|
Ok, this has me stumped. I am trying to get a single record from the DB, which may or may not be NULL.
Dim cmdSelect As New SqlCommand("SELECT weblink FROM dbo.environment WHERE id = 7, sqlDB)<br />
sqlDB.Open()<br />
<br />
sqlRead = cmdSelect.ExecuteReader<br />
<br />
If Not sqlRead.IsDBNull(0) Then<br />
'...Do something with result<br />
Else<br />
'...Do something with NULL<br />
End If
Yet when I do the test using 'If Not sqlRead.IsDBNull(0) Then' , it throws and error: Invalid attempt to read when no data is present.
Yes, I know theres nothing there, thats what I am trying to test.
I cant find anything about how this should work, all examples seem to expect data to be coming back. Help!
|
|
|
|
|
You must call sqlRead.Read() first.
Kelly Herald
Software Developer
MPC
|
|
|
|
|
Oh that was easy, thanks! I would have thought the .ExectueReader command would have sorted that out, but obviously not..
|
|
|
|
|
I have a regular ASP.NET TreeView control on my page that is auto populated from an XML file using DataBindings. In the SelectedNodeChanged event handler routine, I have it make the text of the selected (clicked) node bold.
My problem is: It doesn't matter which node I click on, it always bolds the top most node in that level of the tree. It never bolds the node I selected unless it is the top most node of a level.
It appears as if the page is doing a postback to the server (as it should). But I am not sure if that is the issue. How do I make it so that the node I click on stays "clicked".
Here is what I am talking about:
If this is my tree (below) and I click on "VBScript" it bolds "XML" when it should actually bold "VBScript".
Main
XML
XHTML
Visual C++
Visual Basic
VBScript
UML
PS. Is there a way to implement a control-click event for the TreeView control?
-- modified at 18:59 Wednesday 21st June, 2006
|
|
|
|
|
Do the TreeNodes have the same value? Make sure they should have different values for each node
|
|
|
|
|
That was the problem. Thanks for the tip.
|
|
|
|
|
I am trying to add an Event Procedure to a text field such that pressing the ENTER keyboard button activates the same procedure as clicking the submit button on the form. Apparently asp.net's textbox control does not have an ability to generate those kind of event. Or is there any way to do this?
Thank you
|
|
|
|
|
You can write a javascript function that gets called on the client-side onkeydown (not onkeypress) event. Check that if the character pressed is 13 (ENTER) then submit your form.
Hope that helps.
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|