|
still no luck , i noticed that tblServer.Rows.Count = 0 even though the table i dynamically created has about 4 rows...when i click the button,tblserver is null.. i'm changed my code a little,i now create the new instance in the method instead if page load,i thought that will help..
|
|
|
|
|
It Works
All i had to do was pass the form as a paremeter eg:
protected void Button3_Click(object sender, EventArgs e)
{
searchDynamicControl(this);
}
private void searchDynamicControl(Control parent)
{
......some code here
}
|
|
|
|
|
I have one doubt ... how to use Reporting service in Asp.net 2005..
J. Prabu
|
|
|
|
|
Reporting Services
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Iam wrking in Asp.net project.
I designed the datetimepicker and a textbox to display the value od the datetimepicker.When i click the textbox the datetime picker should come like a dropdown list
how to make it?
asp:TextBox ID="txt" runat="server"></asp:TextBox>
<asp:Calendar ID="Calendar1" Visible="true" runat="server"></asp:Calendar>
I want to use a datetimepicker user control in other forms and acess it.
can anyone help/
modified on Friday, October 3, 2008 3:18 AM
|
|
|
|
|
Hi,
I guess your using the calendar control for ASP.NET...
If so, you can use the OnSelectionChanged event to implement the behavior you want.
<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown">
<asp:calendar id="Calendar1" runat="server" onselectionchanged="cal_SelectionChanged" xmlns:asp="#unknown">
and the code for the event is:
protected void cal_SelectionChanged(object sender, EventArgs args)
{
TextBox1.Text = Calendar1.SelectedDate.ToString();
}
Is this what you want?
Andrei
|
|
|
|
|
how abt AJAX Control popup control ?
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
hello everyone...
i have a problem regarding on Response.AddHeader("Content-Disposition", "attachment;filename=file.xls")
how can i attach the file that has specific directory??
like Response.AddHeader("Content-Disposition", "attachment;filename=C:\\Folder\file.xls") is this possible?
when i tried this codes a got the whole codes of the asp page..not the file i want..
please help...
thanks...
jyn
|
|
|
|
|
in order to use a file from the server try to specify it's path using the Server.MapPath(string path) method.
This will give you the physical path of the file on the server
try this and see if it helps you.
Andrei
|
|
|
|
|
i know now the ans.
Response.WriteFile(App_path & "\Files\\staffreport.xls")
jyn
modified on Friday, October 3, 2008 3:26 AM
|
|
|
|
|
Hi friends
In my project,the image display dynamically in aspx page.how can i export image in excel,pdf file
thanks regards
sara
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
i am new to ASP.NET
Now i am creating a login page
i am using sessions to display the username
Session["str"] = TextBox1.Text;
i am using this Session["str"] where ever i need to display the username
The Problem is when i click logout
the sessions are not removed
how to clear the sessions. i want help.........
|
|
|
|
|
The Abandon method destroys all the objects stored in a Session object and releases their resources use ,
session.Abandon ;
or set session["str"]=null;
|
|
|
|
|
i have got it but have one problem
after logging out when i press back button
every thing remains the same which should not happen
how to do this
|
|
|
|
|
kiranreddy wrote: every thing remains the same which should not happen
You are seeing browser cached version of the page. This can't be stopped effectively.
|
|
|
|
|
You can Clear the session or abondon the session as
Session.Abandon();
or
Session.Clear();
for back button,
You have two option
a: disable the back button
b: clear the hostory
both can be done using javascript
Cheers!!
Brij
|
|
|
|
|
Brij wrote: You have two option
a: disable the back button
b: clear the hostory
option a to my knowledge it cant be done , Please provide the code for it
option b. Yes , Playing with windows history can restrict user from going back
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Brij wrote: You can Clear the session or abondon the session as
Session.Abandon();
or
Session.Clear();
for back button,
No. No events are fired when back button is pressed.
Brij wrote: disable the back button
No reliable methods are available.
Brij wrote: clear the hostory
Not possible.
|
|
|
|
|
Dear
Does anyone know function that can get total days of month?
Socheat
|
|
|
|
|
Use below code
This will give the no.of days for Sep 2008
int noofdays =System.DateTime.DaysInMonth(2008, 10);
Cheers!!
Brij
|
|
|
|
|
Thank for your reply
Socheat
|
|
|
|
|
I have a checkbox that is with in a datalist which is in turn inside a panel.
I am trying to see if a checkbox was checked, to do some action.
how can I find the checkbox?
I get System.NullReferenceException: Object reference not set to an instance of an object.
Thank you.
the aspx.cs code
protected void testb_CheckedChanged(object sender, EventArgs e)
{
CheckBox chkBox = (CheckBox)Page.FindControl("chkMarkerInbox");
if (chkBox.Checked == true)
.....
//also tried this
CheckBox chkBox = (CheckBox) pnlInbox.FindControl("chkMarkerInbox");
if (chkBox.Checked == true)
....
}
Here is the sample code:
<asp:Panel id="pnlInbox" runat="server">
<asp:DataList DataKeyField="inboxID" ID="inboxDL" runat="server" OnItemCommand="DeleteInboxMessage_Click" DataSourceID="inboxDS" CellPadding="0">
<ItemTemplate>
<table border="1">
<tr>
<td>
<asp:CheckBox ID="chkMarkerInbox" runat="server" AutoPostBack="true" OnCheckedChanged="testb_CheckedChanged" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
|
|
|
|
|
First, you need the index of the item you need to get
CheckBox chkBox = (CheckBox) this.inboxDL.items[indexOfTheItemYouWant].findcontrol("chkMarkerInbox")
If you are getting the selectedindexchanged then:
CheckBox chkBox = (CheckBox) this.inboxDL.selectedItem.findcontrol("chkMarkerInbox")
Alexei Rodriguez
|
|
|
|
|
Thanks a lot. How come with the Items it finds it and without just like:
CheckBox chkBox = (CheckBox)this.inboxDL.FindControl("chkMarkerInbox");
It doesn't.
Since it's a data list I have a several row of checkboxes
CheckBox chkBox = (CheckBox)this.inboxDL.Items[1].FindControl("chkMarkerInbox");
When I put Items[1] it only changes state when I check that item.
How do I do it when any checkbox is marked?
Thank you again.
|
|
|
|
|
Albert83 wrote: How come with the Items it finds it and without just like:
CheckBox chkBox = (CheckBox)this.inboxDL.FindControl("chkMarkerInbox");
It doesn't.
Because datalist has many items and wouldnt know which one you want
Albert83 wrote: When I put Items[1] it only changes state when I check that item.
How do I do it when any checkbox is marked?
Loop through all items in datalist with with a for loop datalist.items.count - 1 or for each loop
Alexei Rodriguez
|
|
|
|