|
You need to user ScriptManager.RegisterArrayDeclaration
Have a look here[^]
only two letters away from being an asset
|
|
|
|
|
Hello friends,
I waana a promotion message box when i click on close button which is at the top of the browser.How can i do it? It may be a javascript code.
Thanks in advance.
Cheers,
MAHESH
|
|
|
|
|
Use onclose event and use window.alert for the message.
Books are as useful to a stupid person as a mirror is useful to a blind person. - Chanakya
|
|
|
|
|
Greetings,
I have loaded checkboxes in asp table control at form load evevt; from database.
Now I want to get all checked values in 1 array.
I used for each loop & stored control in 1 checkbox object & if that is checked then add value in array.
my code is as follows
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
fillControls()
End If
End Sub
in fillControls(), I took datatable for Id & name. & added checkboxes as
Dim objTr As New TableRow
For intCnt = 0 To objDataTable.Rows.Count - 1
If intCnt Mod 4 = 0 Then
objTr = New TableRow
table1.Rows.Add(objTr)
End If
Dim objTd As New TableCell
Dim objChk As New CheckBox
objTr.Cells.Add(objTd)
objTd.Controls.Add(objChk)
objChk.Attributes.Add("runat", "server")
objChk.ID = objDataTable.Rows(intCnt).Item(0)
objChk.Text =objDataTable.Rows(intCnt).Item(1)
Next
And when user submit the form< I want to get all id's of checkboxes in 1 array
for that I wrote,
Dim arrSubMnu() As Integer = New Integer() {}
For Each ctl As Control In table1.Controls
If TypeOf ctl Is CheckBox Then
If CType(ctl, CheckBox).Checked = True Then
ReDim Preserve arrIds(arrIds.Length)
arrIds(arrIds.Length) = ctl.ID
End If
End If
Next ctl
I couldn't find out where is error.I am not getting anything in array
Please Help Me to solve this problem
|
|
|
|
|
What is the definition for table1 variable? Is it public? as from the code it looks like it could be used as a local variable.
You could set a break point on the line starting "For Each ctl As Control In table1.Controls" and see if it says that the table contains any controls
If it does then then next line to look at would be the runtime values of the "If CType(ctl, CheckBox).Checked = True Then" line does it say the value is checked? how does that corrospone to the database values?
Any chance you could post the code as a code block? the entire page and behind code?
Phil
|
|
|
|
|
Controls created at runtime will lost at the time of post back. One solution is to call fillControl function outside the If Not IsPostBack checking.
|
|
|
|
|
Finally I got answer
Just using Request object you can get all objects even runtime added
on submit button :
<pre>Dim arrSubMnu() As Integer = New Integer() {}
Dim strT As String
For Each strT In Request.Form
If strT.ToString.Contains("Chk_") And Request.Form(strT).ToString.ToUpper = "ON" Then
Dim strTemp As String = strT
ReDim Preserve arrSubMnu(arrSubMnu.Length)
arrSubMnu(arrSubMnu.Length - 1) = strTemp.Substring(strTemp.IndexOf("Chk_") + 4)
End If
Next</pre>
(here set 'Chk_' as prefix to checkbox id's to find control easily)
|
|
|
|
|
i have migrated the sql server 2005 databse to oracle 10g...
in that one table is having an identity column(auto increment column)
i have done tht using sequence and triggers...
now if i direcltly execute the StoredProcedure,the new row is inserting with the given values..with new RequestID(ie auto increment)
if am executing through code its giving error:
PLS-00306: wrong number or types of arguments in call to 'EDOCSNET_INSEDOCREQHEADER' ORA-06550: line 1, column 7: PL/SQL: Statement ignored .
can anybody tel me how to pass the identity value for the column reguestID?
thanks in advance..
|
|
|
|
|
Don't post same question twice.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
ok..net was down so by mistake it happened.
|
|
|
|
|
Duplicate Question.Please ignore
|
|
|
|
|
Please don' t cross post.
|
|
|
|
|
Hi,
How to add arl_CoList2 to disabled & checked checkboxes and checked the rest of company id from Table1?
Updating company list:
When page loads it will get from tbCompany with checked checkboxes of company id from Table1.
I want to disabled and checked the checkbox (when company id from Table1 exist in Table2 & Table3)
other checkboxes company id can be added if checked. Only enabled checkbox can be unchecked and deleted.
GridView do not have datakeyname.
<br />
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e) <br />
{ <br />
if (e.Row.RowType == DataControlRowType.DataRow) <br />
{ <br />
ds = new DataSet(); <br />
dv = new DataView(); <br />
arl_CoList2 = new ArrayList(); <br />
<br />
ds = otmcl.GetCompany(Session["Dept"].ToString()); <br />
<br />
if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate) <br />
{ <br />
dv = ds.Tables["Company"].DefaultView; <br />
<br />
lbl_CompanyID = (Label)e.Row.FindControl("lblCompanyID");
cb_selectCo = (CheckBox)e.Row.FindControl("CheckThisCompany"); <br />
<br />
ddl.DataSource = dv; <br />
ddl.DataTextField = dv.Table.Columns["CompanyName"].ToString(); <br />
ddl.DataValueField = dv.Table.Columns["CompanyID"].ToString(); <br />
ddl.DataBind(); <br />
<br />
int check = ddl.Items.Count; <br />
<br />
if (check != 0) <br />
{ <br />
GetCheckItems(); <br />
<br />
if (arl_CoList2 != null) <br />
{ <br />
arl_CoList2.Add(hid_id2.Value.ToString()); <br />
<br />
cb_selectCo.Checked = true; <br />
cb_selectCo.Enabled = false; <br />
} <br />
else if (!arl_CoList2.Contains(ddl)) <br />
{ <br />
cb_selectCo.Checked = true; <br />
cb_selectCo.Enabled = true; <br />
} <br />
<br />
} <br />
} <br />
} <br />
<br />
|
|
|
|
|
Hi,
How to Filter/Search context in Office(Word,Excel,pdf documents)
using Indexing Services.
ali
|
|
|
|
|
I know Office documents implements IFilter[^] interface. You can use that to extract text for the indexing service.
Books are as useful to a stupid person as a mirror is useful to a blind person. - Chanakya
|
|
|
|
|
iam having neary 3 webparts in the webpartzone and iam creating two webparts dynamically..now how can i apply themes to this webparts
|
|
|
|
|
I think you must be using some controls in your webpart and that must be in also skin file.If yes, then I dont there is any issue in applying the theme in the new webparts.
If there is another issue please let me know
|
|
|
|
|
|
Hi,
I need to send an email which has an attachment; the attachment is stored in sql server-2005, ina table as an image data type.
Thanks
shank
|
|
|
|
|
Download attachments from database and save in localdrive,then attach it in sending email.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
That database field must be Image type???
You just fetch the data from database and save it into a Stream..then attach it to the email from stream only.
CC26
|
|
|
|
|
Hi,
could you give me some sample code
thanks
|
|
|
|
|
Hi, I am populating a dropdownlist by clientside script.But after every postback the dropdown values vanish.How to persist them?
Thanks
CC26
|
|
|
|
|
DropDownList control have property
AutoPostBack=true If you don't use
selectedindexchange event then set autopostback to false,otherwise post your code and we will see where can be problem.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Probably you didn't get my question.I have no problem with dropdownlist autopostback or anything.
My problem is that, I am populating a dropdownlist using clientside script.
But whenever my page is postback( say...i clicked a button), all dropdownlist items vanish..How to persist them after postback.
CC26
|
|
|
|