|
i have created a number of combo boxes according to my need.no i want to save the changes when any one click update button,but here the control did not find by findcontrol function.
Dim i, j, totc As Long, FcNo As String, cmbcat As Object, fid As ArrayList
catarry = New ArrayList
catarry = CType(ViewState("catgs"), ArrayList)
totc = CLng(ViewState("totcts"))
For i = 0 To totc - 1
'for category combo box
'cmbcat = New Object
'cmbcat = CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList)
'cmbcat = CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList)
'cmbcat = CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList)
If Not CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList) Is Nothing Then
FcNo = CType(Me.FindControl("catpp" & catarry(i * 3 + 1)), DropDownList).Text
End If
StrQry = "update category set cat_order=" & FcNo & " where cat_no=" & "catpp" & catarry(i * 3 + 1)
'Now check for all forums of category
fid = New ArrayList
fid = AllFunctions.PopToarraylist("select Forum_No from Forum where cat_no=" & catarry(i * 3 + 1), 1)
For j = 0 To fid.Count - 1
cmbcat = New Object
'cmbcat = CType(FindControl("frmpp" & fid(i)), DropDownList)
'cmbcat = CType(FindControl("frmpp" & fid(i)), DropDownList)
'cmbcat = CType(FindControl("frmpp" & fid(i)), DropDownList)
If Not CType(Me.FindControl("frmpp" & fid(i)), DropDownList) Is Nothing Then
FcNo = CType(FindControl("frmpp" & fid(i)), DropDownList).Text
End If
'cmbcat.Text
StrQry = "update Forum set Forum_Order=" & FcNo & " where forum_no=" & fid(i)
AllFunctions.UpdateQry(StrQry)
Next
Next
|
|
|
|
|
Where did you add the combo boxes to the Controls collection?
you must add them first in order to find them later.
|
|
|
|
|
i add these comboboxes to diferent dynamic created tables then add these tables to a place holder.you can see different findcontrol function in post i given.
i try following
placeholdername.findcontrol()
tablenames.findcontrol()
but fail.
i done radio button finding on similar technique that working properly but with drop down it not working.
|
|
|
|
|
hi,
i have a c# desktop application, i want to provide a link to download this application in my website
how can i do this.
and i need to show the progress of downloading also.
thanks in advance
My small attempt...
|
|
|
|
|
Hi,
Put your C# application in the wwwroot/Project folder, and use a an anchor tag.
Example:
in code behind, in the page_load (or another appropriate event) give the path of your C# application.
give the file path to the href property of the anchor control. I hope it will work.
Regards,
Blumen
|
|
|
|
|
thanks
My small attempt...
|
|
|
|
|
Hi friends,I have one text box on my form.i need to insert the data from tat text box to DB without clicking on any button.Now i have written the code under text changed event of that text box.So it is inserting whenever i click on that form.Besides this i need to insert data when i close tat window.But it is not inserting when i close tat window.Plse help me.Thanks in advance
With Regards
Lijo Rajan
|
|
|
|
|
Is Lijo Rajan and Tanvisha are some user.
Regards,
Satips.
|
|
|
|
|
I am new to .net and having some difficulties in debugging unmanaged Native DLL in .net..
I am using a Native COM DLL in ASP.Net web application. The problem is I am unable to degul my DLL in .NET. When I add a reference to DLL a interop DLL is created and when I try to load Symbol information manually I am unable to do so.
How can I Debug com DLL here ???
Please Help?
/A
|
|
|
|
|
In your application is there already the DLL is referenced pls check it out.
If the Dll is already referenced delete that one and try to reference the New Dll it will work fine.
Regards,
Satips.
|
|
|
|
|
I tried this but it doesn't work..
|
|
|
|
|
I have to validate my web page using java script. I have one dropdown list also . I need a javascript to validate weather any item in dropdownlist is selected or not. e.g ddlDrop is my dropdownlist.
To validate other controls I am using following
function validate()
{
if (document.getElementById("<%=txtUserName.ClientID%>").value=="")
{
alert("Please Pprovide UserName");
document.getElementById("<%=txtUserName.ClientID%>").focus();
return false;
}
if (document.getElementById("<%=txtPassword.ClientID%>").value=="")
{
alert("Please provide Password");
document.getElementById("<%=txtPassword.ClientID%>").focus();
return false;
}
seema
|
|
|
|
|
you should not use <%=field.client%> insteadyou should use the field name that you have in html page (page.aspx) . you can validate the dropdownlists in two ways:
1. using .value == '' (same way you are validatiing the other fields)
2. using selectedIndex == 0 (provided the first value is dummy e.g. Select One)
and you can access the form field names in two ways:
1. using document.getElementById('fieldname')
2. using form name document.formname.fieldname
-----
|
|
|
|
|
Hi seema, I hope the following code will work for you, if you have any queries please reply.
Assumptions: ListBox name is ListBox1
function ValidateListBox()
{
var varListBox = document.all('ListBox1');
var flag = false;
for(i = 0;i<varlistbox.length;i++)
{
="" if(varlistbox.options[i].selected="=" true)
="" alert("selected="" listbox="" item="" is="" '"="" +="" varlistbox.options[i].text+"'");
="" flag="true;
" }
="" }=""
="" if(flag="=" false)
="" alert("please="" select="" a="" item");
="" return="" false;
}=""
<div="" class="ForumSig">Thanks & Regards,
Partha.G
9989135551
|
|
|
|
|
Try This-:
function Check()
{
if(document.getElementById("<%=ddlDrop.clientID%>").value=="(Select One)")
{
alert('Please select a ddlDrop');
document.getElementById("<%=ddlDrop.clientID%>").focus();
return false;
}
}
Then call this Javascript on Page Load
btn.Attributes.Add("onclick", "return Check();")
If you have any Queries Please ask
Kartik Rathi
|
|
|
|
|
hi
i drog and drop a formView to my webPage and set datesource, but edit,delete,new buttons does not exist in it, how to solve my problem ?
|
|
|
|
|
While configuring your datasource, select Advance button option, and check those check boxes displayed in teh Advance dialog box.
cheers
|
|
|
|
|
I am using a textbox to insert time into a databse table "SQL Server", The column data type in the table is datetime. When i insert it an run the page i see the date 1/1/1900 in the GridView but i don't want it to appear. What should i do to solve this problem.
Thanx in advance for ur help.
yasso
|
|
|
|
|
you have to check the date before displaying on the page, you can do it in sql statement or on rowdatabound, in sql, you can do,
case when datefield='1/1/1900' then '' else convert(varchar, datefield, 101) end as datefield
in rowdatabound
if(row.Cells[datefieldindex].Text=='1/1/1900')
row.Cells[datefieldindex].Text = string.Empty;
-----
|
|
|
|
|
Thx for ur help but i didn't know how to solve it , i am a new developer and i have a little experience. Lets say i want to use the rowdatabound, but what is that a property of the Gridview??
I am using a GridView to display the data and one of its columns displayes the time "with the date that i don't want it to appear". where should i put the code that u sent????
Thanx for ur help
yasso
|
|
|
|
|
well the following code should be used in your SQL STATEMENT or stored procedure whateevr you are using
case when datefield='1/1/1900' then '' else convert(varchar, datefield, 101) end as datefield
or use OnRowDataBound="gv_RowDataBound" in html where you insert the gridview control and int he code behind create a sub
protected virtual void gv_RowDataBound(object source, gridviewroweventargs e)
and use this in this sub
if(row.Cells[datefieldindex].Text=='1/1/1900')
row.Cells[datefieldindex].Text = string.Empty;
look at this [^] for gridview
-----
|
|
|
|
|
Hi,
insted of using text box for date user date picker control
http://www.basicdatepicker.com/
thanks
|
|
|
|
|
Thanx Naif i downloaded it and i am using it on the pages but i am using the insert query in the sqldatasource to write to database, all the other controls in the page appear in the controlID: except the timepicker, how can i use it to write data to database??
Thanx for ur help
yasso
|
|
|
|
|
How can I come to know that in each post back button is clicked or not.
seema
|
|
|
|
|
In your form load event you can check the IsPostBack variable. It is set to true when the page posts back to the web server. Each individual button probably should have it's own onClick event in your code behind.
Ben
|
|
|
|