|
dboy221 wrote: I have asked my hosting solution provider to look into the issue as well
I think this is the best thing. Because the most of hosting providers does have the documentation about how to connect the database in their hosts.. The hosting that I used before never install the database on their webserver. They used to have the seperated database server .....
|
|
|
|
|
Thanks. My hosting provider explain to me that they actually have an instance of SQL Express 2005 running on a separate server. I'll upload my .mdf file to that server and use the necessary credentials for my connection string.
|
|
|
|
|
Hi All,
I want to export to Excel from gridview. I have implemented it.
But if there is paging in gridview, it export only the rows on the particular page.
I want to Export All Rows of all pages.
for example I have 50 records and page size is 10. then there will be 5 pages
10 records per page. if I will export from page 1 then only 10 records will be export.
I want to export All 50 records once.
I use this code to Export to excel :
protected void ExportGridView(Control grdView, string strFileName)
{
string strfName = Server.UrlPathEncode(strFileName);
string attachment = "attachment; filename=" + strfName + ".xls";
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/unknown";
System.Web.HttpContext.Current.Response.Write("<meta http-equiv=Content-Type content='text/html; charset=utf-8'>");
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
grdView.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
Plz Help me.
|
|
|
|
|
If you have the dataset that hold all 50 records, you can generate the excel file by using Microsoft Excel object library.
OR
$unil Dhiman wrote: grdView.RenderControl(htw);
Instead of doing like that, I think you should loop though the dataset that has all 50 records.
|
|
|
|
|
|
I have been hosting my web site with godaddy for about 6 month now (shared hosting). Recently, I am experiencing a huge delay when sending emails (45 min or more). I tried contacting their support and this was their response:
Unfortunately, when messages are sent from scripts on a Windows shared hosting account, there should be a 30 minute to an hour delay. I apologize for any inconvenience this may cause. Let us know if we can help you in any other way.
First of all my application is not a script, it is ASP.NET application,
second of all I definitely did not expect that kind of answer.
My application must be able to interact with user via email and that kind of a delay is completely intolerable.
When I called their support I was put on perpetual hold... I am pretty mach fed up with GoDaddy...
Does anyone else have similar issue with GoDaddy.
Can anyone suggest another non expensive reliable host?
|
|
|
|
|
I have found that emails can be pretty slow, I just implimented them last night. One suggestion - use a different mail server to the one they provide. It's their mail server that is the bottleneck, surely ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Chris.
Thanks for reply. It is definitely their mail server.
I thought of installing an email server on my home PC but that means that I'll have to relay my messages through my ISP and when someone looks at the email and discovers that I am using "Rogers" (local provider) it will seem unprofessional.
Do you know any other strategies to tackle this issue? I honestly think to move to another hosting provider. I had way to many issues with GoDaddy.
|
|
|
|
|
How would someone work out what server the email went through, without doing a lot of digging ?
What issues ? We're just starting with them
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
sergeyv2002 wrote: Does anyone else have similar issue with GoDaddy.
I heard a lot of people has the problems with GoDaddy.
sergeyv2002 wrote: Can anyone suggest another non expensive reliable host?
For windows host, I love DiscountASP.NET. Their service is really great.. For Linux host, I'm currently using DreamHost.
|
|
|
|
|
Hi guys,
I'm having a problem with deleting a cookie in internet explorer. I've got some code that calls the Response.Cookies[CookieName].Expires = DateTime.Now.AddYears(-30); line to try to delete a cookie.
This works fine in Firefox and Safari (haven't tried any others) but it just doesn't work at all in internet explorer 7. I'm really at a loss as to why this is. Any ideas?
I've also tried creating a new cookie with a negative expiration date that has the same name as the old cookie but this doesn't work in IE either (works fine in firefox and safari again).
Thanks
Finn
FinnG -
|
|
|
|
|
1. did you delete the cookie? I think you don't need to minus off 30 years for deleting the cookie. you can just minus 1 day to make the cookie expired.
Example ~
if ( Request.Cookies["UserSettings"] != null )<br />
{<br />
HttpCookie myCookie = new HttpCookie ("UserSettings");<br />
myCookie.Expires = DateTime.Now.AddDays (-1d);<br />
Response.Cookies.Add (myCookie);<br />
}
Ref: How to: Delete a Cookie [^]
2. Make sure both cookies (the one you already created and the one that you added to clear the cookies ) are in the same path.
|
|
|
|
|
I am new to ASP.Net. I worked very little with ASP.Net1.1. Now I am learning 2.0. I have created simple 3 pages application and stored in my local drive. The files aspx and aspx.cs are there in my local. Now I would like to open my application to develop more. How can I do that? Like in asp.net1.1, I used to have a .sln file. If I click the file it used to load the entire application in VS 2003.. Please do tell me how can I open my existing application and work more? Thank you.
Vasini
|
|
|
|
|
You need to use Open Website to open it. By default, .NET 2 doesn't include the solution files for Web Site solutions.
|
|
|
|
|
Click File Menu-> Open -> Web Site.
Then Click The File System icon and Choose the your File Folder.
|
|
|
|
|
Seems like you are new here. If you want to reply the vasini's post, you should click "reply" link under the vasini's post. Now, your post looks like replying Pete O'Hanlon's post.
|
|
|
|
|
|
Hello. This isn't a dating site you know.
|
|
|
|
|
But it *could* be....
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Go on then you smooth talker.
BTW - has the CD arrived yet?
|
|
|
|
|
"I am using MultiView / View controls which change by MenuItem clicks. Each view has a GridView on it with Edit and Insert features bound with <b>SqlDataSources</b>
The problem is: when the edit button is clicked, the GridView disappears and you need to click on the MenuItem again to see it (it happens evrytime you click edit, update, cancel or insert buttons on the GridView)."
Solution Suggested:
In Page_load -
if (!Page.IsPostBack){
//Getting the data from database
//Bind the data to Gridview
// Add this datasource to cache or session (e.g. Cache["mydata"]= dsProject.Table[0]; )
}
else{
//Re-bind the gridview with datasource from cache. (e.g. GridView1.DataSource = (DataTable)Cache["mydata"]
}
<u>To Michael Sync:</u> Hi Michael - the problem is Im using SqlDataSources with the GridViews not DataSets. If I want to change them - it will be lot of changes. Any other suggestions?
Thanks.
Ekjon
|
|
|
|
|
Member 4700225 wrote: To Michael Sync: Hi Michael - the problem is Im using SqlDataSources with the GridViews not DataSets. If I want to change them - it will be lot of changes. Any other suggestions?
1. Can you check whether the GV got disappeared or not without using MultiView Control? Just want to make sure what the problem is. I think it will work.
2. If your gridview works okay without multiview, it might be MultiView1.SetActiveView problem. Can you check whether your the EnableViewState property of MultiView and the views which are in MultiView are true or not. (Ensure that you have checked each and every views.)
|
|
|
|
|
Hi Michael,
In the MenuItems Click event handler, I did already set the ActiveViewIndex to the appropriate index depending on the MenuItem Click, so that should not be a problem. After I read your suggestions, I used SetActiveView instead of ActiveViewIndex. I did EnableViewState="true" for all of them, I even did EnableCaching="true" for the SqlDataSource. Everything works fine as they used to - Except the GridView disappears with edit, update, cancel, insert button clicks. You need to click on the MenuItem again to see it.
I was also thinking that its happening because of the MultiViews. But interestingly, even if I move my GridView out of the MultiView, still does the same. What a puzzle!!!
I am confident though that you can give me more clues!
Thanks so much.
Ekjon
|
|
|
|
|
First time here and I hope to get lucky
I have a really strange problem. My problem is that I can't add a DataGrid to a user control. When I have the code below in a control and register it in web.config it won't show up in the intellisense. If I comment out the DataGrid it works fine. The codebehind is empty.
I register the control in the web.config, but that shouldn't matter.
<code>
<![CDATA[<%@ Control Language="C#" AutoEventWireup="true" Codebehind="EBHObjectListFileControl.ascx.cs"
Inherits="EBHPresentation.Templates.Webcontrols.EBHObjectListFileControl" %>]]>
<asp:datagrid id="DataGridFileList" runat="server" onitemcommand="DataGridFileList_ItemCommand">
Font-Size="Small" ShowHeader="false" AutoGenerateColumns="false">
<columns>
<asp:boundcolumn datafield="Id" visible="false" />
<asp:boundcolumn datafield="FileName1" visible="false" />
<asp:boundcolumn datafield="Date" visible="true" />
<asp:templatecolumn>
<itemtemplate>
<asp:linkbutton id="LinkButtonOpenDocument" commandname="OpenFile" runat="server">
<%# DataBinder.Eval(Container.DataItem, "FileName2") %>
</asp:linkbutton>
</itemtemplate>
</asp:templatecolumn>
<asp:templatecolumn>
<itemtemplate>
<asp:imagebutton id="ImageButtonDocumentDelete" commandname="DeleteFile" runat="server">
ImageUrl="../images/delete.gif" OnClientClick="if(!confirm('message')) return;" />
</asp:imagebutton></itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
</code>
Thanks and regards,
--Tomas Jansson
|
|
|
|
|
mastoj wrote: < ![CDATA
Why did you add this?
mastoj wrote: The codebehind is empty.
The code-behind file should not be emply. (You are using ASP.NET 1x, right? )
At least, it should be something like that ~
namespace WebApplication3<br />
{<br />
using System;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Web;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.HtmlControls;<br />
<br />
public class WebUserControl1 : System.Web.UI.UserControl<br />
{<br />
protected System.Web.UI.WebControls.DataGrid DataGrid1;<br />
<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
}<br />
<br />
#region Web Form Designer generated code<br />
override protected void OnInit(EventArgs e)<br />
{<br />
InitializeComponent();<br />
base.OnInit(e);<br />
}<br />
<br />
private void InitializeComponent()<br />
{<br />
this.Load += new System.EventHandler(this.Page_Load);<br />
<br />
}<br />
#endregion<br />
}<br />
}<br />
I think there are some wrongs in creating the user control. How did you create your usercontrol? What you should do is that just add the Web User Control in your project. Then, add the DataGrid to your user control. that's all you need.
mastoj wrote: I register the control in the web.config
Why do you need that?
|
|
|
|