|
no i not mean that
according to me store your items of drop down in one variable either its a viewstate or static
for Ex.
static DataTable dt = null;
on page load
if(!ispostback)
dt = getAlldropdownitem();
now when u click the check box
on check box click
ddl.datasource = dt ;
....
like that
so that only one time you have to hit database to get all items and on click you are assigning vlaue of that so its also reduce cost of viewstate associated with each drop down
|
|
|
|
|
I have written a utility to retrieve images based on entries in a database. All addresses exist but the process is moving extremely slow. When tested through a browser there is no problem. Possibly someone can give me an idea on how to speed the process up. there are a lot of images and they are downloaded each day at approx 4:00 AM. I am posting code below and would like to thank you in advance for your comments and help.
foreach(DataRow dr in Queries.GetInventoryByDealerInventoryID(connstring, dealerinventoryid).Rows)
{
string[] arr = dr["ThirdPartyImageURL"].ToString().Split(new Char[] { ',' });
if (arr.Length != 0)
{
foreach (string s in arr)
{
Console.WriteLine("Getting: " + s);
try
{
if (s.Length != 0)
{
WebRequest request = WebRequest.Create(s);
//WebProxy proxyObj = new WebProxy("**.***.***.**",****); NOT USED ANY LONGER
//request.Credentials = CredentialCache.DefaultCredentials;
//request.Proxy = proxyObj;
WebResponse response = ((WebResponse)(request.GetResponse()));
Stream datastream = response.GetResponseStream();
string[] arrImage = s.Split(new Char[] { '/' });
string tmpImage = arrImage[arrImage.Length - 1];
Console.WriteLine(tmpImage);
/// <remarks>
/// CHANGE THE PATH RETREIVED FROM THE DATABASE TO THE E DRIVE SO IMAGES CAN BE PROPERLY RESIZED AND RENAMED
/// </remarks>
string dealerImagepath = imagepath.ToLower().Replace("f$", "e$");
if (!Directory.Exists(dealerImagepath))
{
/// <remarks>
/// SEND EMAIL NOTIFICATION ABOUT THE BAD DIRECTORY NAME
/// </remarks>
}
int buffersize = 1024;
try
{
FileStream fs = File.Create(dealerImagepath + tmpImage, buffersize, FileOptions.Asynchronous);
byte[] Buffer = new byte[buffersize];
int bytesRead = 0;
while (true)
{
bytesRead = datastream.Read(Buffer, 0, buffersize);
if (bytesRead == 0)
break;
fs.Write(Buffer, 0, bytesRead);
}
fs.Close();
fs.Dispose();
request.Abort();
}
catch (Exception ee)
{
bool bReturnLog = false;
ErrorLog.LogFilePath = "ErrorLogFile.txt";
bReturnLog = ErrorLog.ErrorRoutine(false, ee);
}
}
}
catch(Exception ee)
{
bool bReturnLog = false;
ErrorLog.LogFilePath = "ErrorLogFile.txt";
bReturnLog = ErrorLog.ErrorRoutine(false, ee);
}
}
}
}
|
|
|
|
|
Format the code using pre tags.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello there
I've got an new assignment. The requirement is that I should be able to display an image in a webform and let the user draw circles(using something like a paint brush) on different parts of the picture. I should be able to save the image with the circles in position.
I did google for a couple of hours but could not come up with anything solid. I would appreciate if someone could guide me which way to go.
Thanks.
Kit
|
|
|
|
|
I believe Silverlight or similar technology would be the way to go for this
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Ya. Even exporing adobe flex can also help.
|
|
|
|
|
oh..Is it not possible to achieve it only using Javascript amd asp.net ???(i mean without going for silverlight or flash)
Kit
|
|
|
|
|
Hello,
In our project, we have a requirement to export a web page (Asp.Net) to PDF file. All the controls on the page (The web page completely along with its format) should be exported to PDF file. Anybody has worked on this before?
Can you please shed some light on this to get it work?
As we have some constraints, we have to do it without spending money.
Thank you in Advance,
Raheem MA
|
|
|
|
|
|
Anurag,
Thank you for your reply.
I did go through the links you provided. First one, AltSoft might match our requirement but it is not free of cost. Second One, just creates PDF files in Asp.net but does not export the asp.net page to PDF.
Our requirement is exporting the complete Asp.net page (.aspx) to PDF file.
Can you please provide any other information regarding this.
Thank you in Advance,
Raheem MA
|
|
|
|
|
|
Hi Raheem
The procedure is
step1:render the page through asp.net code in a web browser, this will return a bitmap
public System.Drawing.Bitmap CaptureWebPage(string URL)
{
// create a hidden web browser, which will navigate to the page
System.Windows.Forms.WebBrowser web = new System.Windows.Forms.WebBrowser();
web.ScrollBarsEnabled = false; // we don't want scrollbars on our image
web.ScriptErrorsSuppressed = true; // don't let any errors shine through
web.Navigate(URL); // let's load up that page!
// wait until the page is fully loaded
while (web.ReadyState != System.Windows.Forms.WebBrowserReadyState.Complete)
System.Windows.Forms.Application.DoEvents();
System.Threading.Thread.Sleep(1500); // allow time for page scripts to update
// the appearance of the page
// set the size of our web browser to be the same size as the page
int width = web.Document.Body.ScrollRectangle.Width;
int height = web.Document.Body.ScrollRectangle.Height;
web.Width = width;
web.Height = height;
// a bitmap that we will draw to
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(width, height);
// draw the web browser to the bitmap
web.DrawToBitmap(bmp, new System.Drawing.Rectangle(0, 0, width, height));
return bmp; // return the bitmap for processing
}
Step 2: and then save this as PDF
|
|
|
|
|
Thank you Deepika for your response,
But I dont want to capture the complete webpage. Following is the scenario:
We have "Export" button on every webpage(contains Charts, graphs etc...). On Export button click, the charts , graphs ... of the particular page should be exported to PDF file.
Any ideas ?
Thank you in Advance,
Raheem MA
|
|
|
|
|
Hi Raheem
You need to create one page named preview and render only those things which u need to export on that page (if it is a chart then only render chart on that page) and then try that code.
at the time of export just redirect to the export page(another page which will run the bitmap and web browser code) which will do the stuff for you and then call the preview page in url then it will export only charts etc.
Thanks
Deepika
|
|
|
|
|
Hello Friends,
My requirement is we will have many Asp.Net server controls on a webpage and a export button. On clicking Export button, all the content & asp.net controls should be exported to PDF file.
Please help me, this is urgent.
Thank you in Advance,
Raheem MA
|
|
|
|
|
Hello Experts
I've this Gridview of tasks a Hyperlink TemplateField that takes the user to another page where he can accept/reject[buttons] the very task , on clicking accept/reject[buttons] the page redirect the user again to the tasks Gridview , unfortunately , the same task is still there unless if the user manually Press F5[Refresh] I tried the following nothing worked
1- EnableViewState ="false"
2- In the ObjectDataSource , EnableCaching ="false"
3-i tried to use Ajax but it gives me a whole lots of errors from the webconfig ,my website is working ,I can’t stop users from accessing my site in order to wrestle with Ajax
what else that I can do?
One more question Experts,
the approach I am taking on developing my site is to work in my local machine when I am finished with my changes I literally Copy/Paste the new aspx/aspx.vb overwriting the old file with the new one , this approach is working fine but it causes the server to a bit slow esp. in the first time after change, is there a more Professional way?
Thanks in advance
|
|
|
|
|
Another Page is opening in PopUp ???
|
|
|
|
|
on hyperlink click it redirects the user to Another Page
|
|
|
|
|
hi all,
I use sql server 2005 and C#(asp.net) to build a library system (web site),
but my problem is..
i can insert a row into database at datetime format MM/dd/yyyy, but if my server date format changed to any format my web site is stop work and do an exception ..( the conversion of a char data type to a datetime data type resulted in an out-of-range datetime value).
can u help me please,,,
thanks all
|
|
|
|
|
Hi,
could you post the code how you are trying to insert the new row? I guess the sql-server is expecting a datetime-row and you try to store the date as string.
Regards
Sebastian
|
|
|
|
|
Try to Change the DateFormat to MM/dd/yyyy before inserting into database
Like this
DateTime.Today.ToString("dd-MMM-yyyy")
|
|
|
|
|
I have deployed a project in ftp location. It is a .net with mysql application.
But i am trying to open the site getting the execption like the following
"Unable to connect to any of the specified MySQL hosts.***********System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 174.143.28.30:3306 at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) at MySql.Data.Common.StreamCreator.CreateSocketStream(IPAddress ip, Boolean unix) at MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout) at MySql.Data.MySqlClient.NativeDriver.Open() "
But i could connect the remote mysql server from my local application.Its working fine at time..
If anybody knows why this occur,please replay .Thanks in advance
|
|
|
|
|
so this problem doesn't happen when you connect to the localhost but when you try from a other pc to connect to the server it doesn't work?
|
|
|
|
|
Hi i am new to CMS.
From where i can get CMS basics
|
|
|
|
|
Hi All,
How to clear session when i close the browser.
I have assigned the following value in session
Session["SessionId"] = sessionId;
Session["userId"] = userId;
I want to clear this value while user close Browser
Thanks and regards,
Amit Patel
|
|
|
|