|
I have a dataset with 2 datatables. I wish to export those 2 datatables in excel in 2 seperate sheets. How can I do it..? Thanks in advance.
|
|
|
|
|
One simple way could be to open a Excel connection using ODBC, iterate all the rows and dump it in Excel !!!
|
|
|
|
|
Hi,
In my application,i have a table with one of its column of 'hyperlink' type. On click of that data i need to open a popup window..i have written folowing code for the same:
<asp:HyperLinkField NavigateUrl="javascript:JobDetails()" DataTextField="JOB_ID" HeaderText="JOB ID" SortExpression="JOB_ID"/>
and the javascript code is:
<script language="Javascript" type="text/javascript">
function JobDetails()
{
ChildWindow = window.open('frmJobDetails.aspx', 'Job Details', 'width=200,height=200,top=400,left=600,toolbars=no,scrollbars=no,status=no,resizable=no,titlebar=no');
}
</script>
My problem is that when i cntrl+click on the 'NavigateUrl' attribute of HyperLinkField, it says page cannot be displayed. Kindly do tell me what is wrong...or some other way of showing popup...me new to asp.net, so please explain how to do it...
Thanks
|
|
|
|
|
Hi
U r clicking from ur code window.So it is not executing.
I think it is trying to open the URL:javascript:JobDetails().
But it is not a valid URL.
Thats Why......
If U Have Interest, U Can...
Sherin Iranimose
|
|
|
|
|
|
I would certainly suggest that you attach an attribute and have onClick event associated with javascript for each of the links .....
|
|
|
|
|
Hi All,
How all the checkboxes get checked as the header checkbox is checked or selected
|
|
|
|
|
use javascript
------------------------------
If u think u can, u can.
If u think u can't, u r right.
|
|
|
|
|
you can create controll array.
And map each array item to each check box.
so u need to iterate through that array to check or uncheck..
If U Have Interest, U Can...
Sherin Iranimose
|
|
|
|
|
Hi,
Do as follows. Please let me know if you face any issues.
1. First, code in the aspx page, html view as follows:
<asp:datagrid id="dgAnalDelete" runat="server"><Columns>
<asp:BoundColumn HeaderText="Sl.No"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Visible">
<HeaderTemplate>
<input type="checkbox" id="checkAll" onclick="CheckAll(this);" runat="server" NAME="checkAll">(Un)Select All
</HeaderTemplate>
<ItemTemplate>
<asp:Checkbox runat="server" ID="chkID" Checked='<%# GetChecked(DataBinder.Eval(Container, "DataItem.Selected").ToString()) %>'>
</asp:Checkbox>
</ItemTemplate>
</Columns>
</asp:datagrid>
2. Write the javascript function as follows:
function CheckAll( checkAllBox )
{
var frm = document.Form1 ;
var actVar = checkAllBox.checked ;
for(i=0;i< frm.elements.length;i++)
{
e=frm.elements[i];
if ( e.type=='checkbox' && e.name.indexOf("chkID") != -1 )
e.checked= actVar ;
}
}
Happy Coding!!
Meeram395
|
|
|
|
|
i have to secure web pages individually. If a user whose role is admin if he logs then only he should be able to view the page otherwise he should be
redirected to other page . How can this be done. please help me.
You cannot be in love and be wise.
|
|
|
|
|
Hi,
U could do this simply by creating a config file and put all secured pages along with the created config file to a folder. Use the attributes that defines the config file for admin role.
Bijay Bhaskar Deo
Thanks & Regard
|
|
|
|
|
You can set session inside login page.
From login page redirect to a middle page.
from middle page Check session for user role.
if
admin redirect to secure page
else
redirect to another page
eg: from login page
Session("role")=user_role
redirect to middle_page
From middle page
if(Session("role") = "admin") then
redirect to secure page
else
redirect to another page
If U Have Interest, U Can...
Sherin Iranimose
|
|
|
|
|
First thing in sitemap.config add the attribute role and specify the respective role. In each page check the users role with role details for that site map node. For all none valide users redirect them to other page...
|
|
|
|
|
Hello;
I develop website and uploaded to host provider and works fine but I uploaded it to ther hosting provider and it not working and give this problem
-----
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
-----------------
I called to host provider to able asp.net permission read/write but still the same problem;;;
what possibe wrongs or bugs in hosting provider or website.....
thanks
tkml123
|
|
|
|
|
Hi,
first change the mode attribute value to off in your web.config file so that you can see the actual error.
<customErrors mode="Off"/>
Regards,
Sandeep Kumar.V
|
|
|
|
|
I would suggest that change the config file section
<system.web>
<customerrors <b="">mode="On" defaultRedirect="mycustompage.htm"/>
So that it seen both at the remote and local locations, Once you see the post the actual stack trace here with exception details.
|
|
|
|
|
Hi
I got an error while trying to send an email from my asp.net 2.0 application. The given error was...
mail box unavailable. the server response was : (servername)[serverIP] is currently not permitted to relay through this.
I hope i will get some help to solve this problem..
Thanks in advance
Sebastian
|
|
|
|
|
I think the mail server doesn't all mail services from out side the network
|
|
|
|
|
Thanks for your reply. i will check this out soon. Actually the code was working fine in my local machine. When i uploaded the application to a server i got the above error.
Sebastian
|
|
|
|
|
If you've specified a public SMTP (Yahoo / Gmail etc), then most stop relaying to prevent spammers.
Use an open server, or set up your own (SQL Server has one built in)
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
Thanks for your reply. i will check this out soon. Actually the code was working fine in my local machine. When i uploaded the application to a server i got the above error. if the mail server is not relaying, i wouldn't have been able to send mail from my local machine. Then what should be the problem...
Awaiting for your reply..
sebastian
|
|
|
|
|
Just out of interest, which mailserver are you using - sure you've not got a hard coded machine name in there somewhere, pointing to your localhost?
Sebastian T Xavier wrote: if the mail server is not relaying, i wouldn't have been able to send mail from my local machine
Agreed, but the error you posted is telling you that it can't relay - it may not be that it can't per-se, just that some condition (same domain etc...) isn't satisfied...
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
Hi all..........
I am in a problem like..
I am using datalist item . In edit item template of datalist i have some controls like textbox. At the time update button click i need to validate the edit template.Here i need to validate one textbox with a date formate like dd/mm/yyyyy. I have the function of that date formate but when i am validating HOW TO FIND THE TEXT BOX.In itemdatabound event also i am not getting the control plz help me if any one have idea...
Suresh.R
|
|
|
|
|
Hi,
Not sure that this is what you are looking for, but here I go!
You can get a reference to the control by using the FindControl method in the updateCommand method. With this reference you can cast it to the given control and then you can use the properties for that control.
In the example I'm using a label:
protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)<br />
{<br />
Label lbl2 = (Label)DataList1.Items[e.Item.ItemIndex].FindControl("Label2");<br />
<br />
Label1.Text += "<br><br>" + lbl2.Text;<br />
}
You can also assign values to the control, and update the datasource.
Hope this helps.
|
|
|
|