|
manugrg wrote: I need to populate a listbox named "subcategory" once the user clicks his desired selection in dropdownlist named "category"
In server side you can do like this
1. Make autopostback to true for category dropdown
2. On selected index changed event of category write the following code
if( category.SelectedItem.Text == "c++" )
{
subcategory.items.add("polymorphism");
subcategory.items.add("overloading");
subcategory.items.add("something");
}
But this method will make a postback each time when you change category. For avoiding postback use javascript
|
|
|
|
|
Try this:
strSql = "SELECT ID , Name FROM sysTable"
objDT = objDB.ExecuteDatatable(strSql)
If objDT.Rows.Count > 0 Then
With cmb
.DataSource = objDT
.DataTextField = objDT.Columns(1).ToString
.DataValueField = objDT.Columns(0).ToString
.DataBind()
If IsDefaultValueNeeded Then
.Items.Insert(0, New ListItem("Select", -1))
End If
End With
End If
On SelectedIndexChanged of combo Fill the listbox
strSql = "Ur Query"
objDT = objDB.ExecuteDatatable(strSql)
If objDT.Rows.Count > 0 Then
'Fill ListBox With Column Display Name
With lstsource
.DataSource = objDT
.DataTextField = objDT.Columns(3).ToString
.DataValueField = objDT.Columns(0).ToString
.DataBind()
End With
Endif
hope this helps u...
|
|
|
|
|
how to connect a string array fileList in the gridview .i am doing it as
DataSet ds = new DataSet();
DataTable dt = new DataTable();
dt.Columns.Add("title", typeof(String));
DataRow newRow;
foreach (DataRow row in fileList)//???<u>i am not getting how to do this </u> {
newRow = dt.NewRow();
newRow["title"] = Title;
dt.Rows.Add(newRow);
}
GridView1.DataSource =dt.DefaultView ;
GridView1.DataBind();
}
GridView1.AutoGenerateColumns = false;
GridView1.DataBind();
on aspx page
<asp:GridView ID="GridView1" AutoGenerateColumns="true" runat="server" ShowHeader="False" GridLines="None" OnRowCommand="GridView1_OnRowCommand" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="Hyperlinkpolicy" runat="server" Text='<%#Eval("fileList") %>' CommandArgument='<%#Eval("fileList") %>' CommandName="button" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
pls help me out .
thanks in advance
-- modified at 2:24 Thursday 15th March, 2007
thanks in advance .
|
|
|
|
|
i have parent.aspx and child.aspx pages,child.aspx ia a modal dialoug box.when i click a link on parent.aspx page child.aspx will open. if i close child.aspx ,parent.aspx will refresh..upto this it working well..
if i again click on the same link the child.aspx page show the old data..the page load is not working.
if i click another unclicked link..the page load work..
so for a link in parent.aspx only one time the page load work in child.aspx
how can i solv it?
thks
yesu
|
|
|
|
|
ypki wrote: if i again click on the same link the child.aspx page show the old data
Browsers cache is making problem. Next time it is showing from browsers cache. To avoid set the browsers cachebality to none in child.aspx
|
|
|
|
|
Dear all,
i am making web application using asp.net2.0,C#,sql2000
i generated report in local mode that say report.rdlc.
my question is can i print this report. if yes please give some usefull link or example
thanks
regards
imran khan
|
|
|
|
|
Do you want to print the contents in the browser ? Then use document.print() in javascript
|
|
|
|
|
Hi All,
My question is that if any one has a module or function that encrypts and then decrypts specific data of any type. I have a case where i want to save data encrypted in sql 2005 and then show it decrypted for specific users only. I am using asp.net 2.0 and sql 2005
Any help is really appreciated and thanks in advance.
|
|
|
|
|
samerh wrote: I have a case where i want to save data encrypted in sql 2005 and then show it decrypted for specific users only
In SQL 2005 you can use symmetric encryption to encrypt and store data. For that check this article[^]
To encrypt from code behind and store in database check this
www.codeproject.com/aspnet/encrypt.asp[^]
|
|
|
|
|
i want whether check box is checked or not at client sied
check box is in grid column help me
|
|
|
|
|
Hi
Check this example, if this is not clear, please do reply..
<script language="javascript" type="text/javascript">
function CheckBoxFunction()
{
var el=document.form1.elements;
for(x=0;x<el.length;x++)
{
if(el[x].type=="checkbox")
{
if(el[x].id.indexOf("CheckBoxIDofGrid") != -1)
{
if(el[x].checked == true)
{
}
}
}
}
}
</script>
Harini
|
|
|
|
|
Thnaks for reply
i am not geting //Take ClientID (ie. GridView_101_CheckBoxID) of CheckBox and do the process based on this ID. whats this
grdJobSynchReq my grid id and i am addung check boxes at run time with CheckBox1 id
|
|
|
|
|
|
Hi i have intime(08:45) and outtime(20:16) => 24 hours format...,
Now i want to calculate between the time,
how many hours and minutes like...,
Plz help me,i need that codes.........,
Regards,
Magi
|
|
|
|
|
Hi,
take two strings for intime(in) and outtime(out). and write code for diff
DateDiff(DateInterval.Minute, in, out)
U will get diff in miutes.
|
|
|
|
|
Hi datediff its not working for this probs,
see i have intime and outtime in string fromat,
means in this format "08:58" and "19:45" like,
now i want hours and minutes both in string format like.....,
The output will look like this format,"10:47"
Plz help me.......,
regards,
Magi
|
|
|
|
|
this problem can be solved by using timespan
specify,
TimeSpan ts = outtime.Subtract(intime);
|
|
|
|
|
Good morning!!
I have used one user control on number of pages in a Project,developed in c# using Asp.net 2.0.
There are number of LinkButtons used on the user control, but on one page click events of the LinkButtons are not fired .
None of the button is clickable.
Why it is happening so ?
Can somebody help me out ?
Thank you.
following is code snippet
.aspx contents of User Control =>
<asp:linkbutton id="lbtnFeedback" runat="server" cssclass="link_small_pink_question" style="position: relative; left: 14px" onclick="lbtnFeedback_Click">
aspx.cs contents of User Control=>
protected void lbtnFeedback_Click(object sender, EventArgs e)
{
try
{
Session["SellerID"] = SellerId;
Session["ShopId"] = shopID;
Response.Redirect("MCBioFeedback.aspx", false);
}
catch { }
}
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
User Control file name should be ascx instead of aspx
Are you putting right Id of control in aspx
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
thanks for replying
extension file is ascx.
The control is working fine on other pages but on one page it has stopped working at all.
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
If the user control is working fine in other pages and its events are called properly then might be the problem in aspx page only
See the Register tag and id given to control on aspx should match with aspx.cs page .
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
How many languages .NET is supporting now i searched on net but i didnt get correct solution to this question.it wuld b very helpful if any one can answer this question
Thanks in advance
|
|
|
|
|
|
Hi,
One requirment in ASP.NET web application that to call and use the form and its controls, developed in Window-based C#.
please help.
Thanks & regards
|
|
|
|
|
hi friends
i have on user control
on this i have one dropdownlist control
on change of this control i am filling datagrid contents using ajax
in datagrid i have one template column in template column's item template i have link button
on click of link button i have to fill some other details
my problem is
when i am filling datagrid contents using ajax
i am not able to handle template columns link button
how can i add link button to datagrid
using ajax
when ever onchange of dropdown list control fires
link button gets disapper
how can i solve this
thanks
|
|
|
|