|
thanks brij its working with
java script;
thanks rakesh for ur time.
|
|
|
|
|
your welcome
Cheers!!
Brij
|
|
|
|
|
Hi everyone..
just want to get some ideas what will be the best approach to do this..
My aim is to add a gridview within an ajax updatepanel onto my asp.net page which has a templatecolumn with a dropdownlist inside. but I want the dropdownlist to only populate the options item when it is CLICKED on since I think there will be a performance issue if I bind the dropdownlist beforehand. e.g. if I have 20 items in each dropdownlist, and there are 10 rows per gridview page then it means I have to populate 20 X 10 dropdownlist item on the page which doesn't sound really good... especially the dropdownlist items may be the same.
can anyone suggest any solution to do this?
thanks,
Wilson
Still a newbie.. learning
|
|
|
|
|
if all dropdown going to have same items than do following thing
step 1 : get list of item in one viewstate or in static variable
setp 2 : bind the dropdown with viewstate or static variable only when the check box of the particluar column get click
i hope by this way you can easily reduce the cost of bidnding
|
|
|
|
|
thanks for you reply Pranay,
so do you mean I just need to bind 1 single drop down.
but then how do I load the view state for the other drop down? so will only 1 set of drop down items appear within the html page?
thanks,
Wilson
Still a newbie.. learning
|
|
|
|
|
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
|
|
|
|