|
Hi;
Thanks for reply.It works if i put entire table into update panel.but not working i keep another table outside updatepanel.Here is my code
<table class="style1">
<tr>
<td class="style2">
enter your name</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<table class="style1">
<tr>
<td class="style2">
select any one</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
<asp:ListItem>a</asp:ListItem>
<asp:ListItem>b</asp:ListItem>
<asp:ListItem>c</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="style2">
your select is</td>
<td>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</tr>
</table>
|
|
|
|
|
Hi, you must have trigger
like this
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="DropDownList1" />
</Triggers>
</asp:UpdatePanel>
Thanks
|
|
|
|
|
Hi,
I have a datalist with a button in it. I want to display this button when Advance user logins and make the button invisible when simple user logins. So I want to make the button in the Datalist invisible dynamically. Please tell me how I can acess a button in a datalist to my code. Please reply me if you know any solution to solve this.
Thanks in advance.
|
|
|
|
|
for(int i=0;i<datalist1.items.count;i++)>
DataList1.Items[i].FindControl("Button1").Visible = false;
Hope this wil do...
|
|
|
|
|
u can write the code inside datalist_Itemcreated event
if session(USerNAme) = "super" then
DataList1.Items[i].FindControl("Button1").Visible = true;
else
DataList1.Items[i].FindControl("Button1").Visible = false;
endif
hope this code will work....
kannak
|
|
|
|
|
iam using asp.net 1.1 in which i request an another page and sending response using request.responseXML.documentElement
when i am sending the xml <sale><table><sno>1</sno><sno>2</sno></table></sale>
it works fine
but when i am sending the response like
<sale><table><sno>1</sno><sno>2</sno></table><t2><name>abc</name><name>xyz</name></t2></sale>
it gives error.
i dont know whr i m wrong.
Er. Jagwinder Singh
modified on Thursday, April 23, 2009 1:12 AM
|
|
|
|
|
Nonu Walia wrote: but when i am sending the response like
12
abcxyz
it gives error.
what is the error?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
error is null
when i check response using alert it gives null
e.g
alert(response);
Er. Jagwinder Singh
|
|
|
|
|
I have two user controls. The first user control starts a table with one row with 3 columns and starts a second row and starts the second cell. The second user control ends what the first control started.
I place the first user control on a page, then I add say a list box and finally add the second user control. The outcome of this is the Top, bottom and sides of the table are predefined in the user controls.
Now my problem... The listbox is not visible. I think it is hidden behind the user control.
When I View Source the tables appear to be correct. Does anyone have any ideas why the listbox does not appear?
Here is the code:
Top User Control "PanelTop1"
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="PanelTop.ascx.vb" Inherits="UserControls_Panels_PanelTop" %>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="PanelTopLeft" width="14px">
<asp:Image ID="Image1" Height="1px" Width="14px" runat="server" />
</td>
<td class="PanelTopFill" width="100%">
</td>
<td class="PanelTopClose" width="41px">
<asp:Image ID="Image3" Height="1px" Width="41px" runat="server" />
</td>
<td class="PanelTopRight" width="23px">
<asp:Image ID="Image2" Height="1px" Width="23px" runat="server" />
</td>
</tr>
<tr>
<td class="PanelLeftFill">
</td>
<td colspan="2" >
Bottom User Control "PanelBottom1"
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="PanelBottom.ascx.vb"
Inherits="UserControls_Panels_PanelBottom" %>
</td>
<td class="PanelRightFill">
</td>
</tr>
<tr>
<td class="PanelBottomLeft">
</td>
<td colspan="2" class="PanelBottomFill">
</td>
<td class="PanelBottomRight">
</td>
</tr>
</table>
Page Usage:
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="3">
<uc2:PanelTop ID="PanelTop1" runat="server" />
<table class="PanelTable">
<tr>
<td>
<asp:ListBox ID="ListBox22" Visible="true" AutoPostBack="true" Rows="20" Width="100%"
runat="server" BackColor="#FF0066"></asp:ListBox>
</td>
</tr>
</table>
<uc3:PanelBottom ID="PanelBottom1" runat="server" />
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
|
|
|
|
|
I want to say I found the problem but the truth is I removed the table around the list box and it worked!
I replaced the table and it still worked! I don't know what the problem was but it is fixed now.
|
|
|
|
|
Hey folks,
I need to build an application that does some local file manipulation (editing, copying, etc.) on the behalf of the user.
How restrictive is ASP in terms of client side machine access?
I could just write a client-server app instead, but seems like that would take bit more effort.
Thx
NIK
|
|
|
|
|
nicknotyet wrote: How restrictive is ASP in terms of client side machine access?
All you need is to give the asp user account permission to the folder where the files are located. It is that simple.
[edit] my bad. I did not read OP post completely. There is no way you can access the client machine from asp.net [/edit]
modified on Thursday, April 23, 2009 9:32 AM
|
|
|
|
|
Really!!!
So I can just use something like
string path = "C:\\MyFiles\SomeFile.Txt";
File.OpenText(path);
...
in code behind?
|
|
|
|
|
No. Actually, ASP/ASP.NET will not have any access to the client's computer drives at all. I think only an ActiveX control might be able to access client files. Doing what you wrote would open SomeFile.Txt in the C:\\MyFiles directory of the server.
Scott
|
|
|
|
|
One Yes and One No - I am well confused.
|
|
|
|
|
nicknotyet wrote: One Yes and One No - I am well confused.
my bad. I have to read your post again. scottgp is right, you can not access client machine from asp.net. I read your post as you want to access server files.
The only way you can access client machines is through explicit permission of the use and other technologies such as activex.
sorry of the confusion, I take my earlier post back
|
|
|
|
|
No worries, at least I can make an informed decision.
I am kind of inclined to just do this old-school and roll my own pseudo database and write the app in straight C/++. It will be screaming fast and have no platform dependencies. The time I would have spent ramping up on SQL, .NET, DAO, IIS, etc, can be spent on implementation.
Thanks again for the input.
NIK
|
|
|
|
|
I have a query suppossed to return average values (SELECT AVG(DATA_VALUE)....).
However, it returns null when no data is present for the matching criteria.
I am using a data reader to read the value. like:
<br />
dr = cmdSelect.ExecuteReader();<br />
if (dr.HasRows)<br />
{<br />
dr.Read();<br />
string getAvg = dr.GetString(0);<br />
if (getAvg != null)<br />
{<br />
valArr[0] = Convert.ToDouble(getAvg);<br />
log.Add(...);<br />
}<br />
else{...}<br />
} <br />
Funny thing is - dr.HasRows is true because the query is returning a record even though the value is null. I also tried GetObject(0) instead of GetString(0), and tried cmd.ExecuteScalar() instead of ExecuteReader(), but still could not manage it. Its going to an Exception saying - "Data is Null. This method or property cannot be called on Null values."
Any help? Thanks.
|
|
|
|
|
all you need is DBNull[^]class
<br />
if (! DBNull.Value.Equals(dr[fieldName])) <br />
{<br />
}
|
|
|
|
|
You can handle that as below:
if (dr["fieldname"] != null)
{
//do something
}
|
|
|
|
|
|
I have tree view control on my asp.net web page.
this tree control has check boxes on every node.
I want when user selects or make parent node check box checked then its child should also get checked automatically.
how can i do this ?
kindly its urgent, plz send some code hints.
|
|
|
|
|
Write some fancy javascript to update all the sub nodes that contain a checkbox, or put the treeview in an ajax panel and use server side code to check all the checkboxes.
I didn't get any requirements for the signature
|
|
|
|
|
we r using asp.net and we have also created check boxes, we want parent node check box checked then its child should also get checked automatically.
|
|
|
|
|
enumerate though the childnodes and check the checkboxes.
Post your code so you can get further help.
|
|
|
|