|
User will enter Customer Code based on the customer code all batches will bind into gridview (Which have 1000+ records) these (gridview)values should insert into another table
|
|
|
|
|
i have a web site with some sub domain for rewriting i use this code in web confic.
<pre lang="c#">
<if header="HTTP_HOST" match="^(?:www\.)?([^.]+)\.([^.]+)\.([^.]+)$"> <set property="subdomain" value="$1"/> <set property="domain" value="$2"/> <set property="tld" value="$3"/> <rewrite url="~/Default.aspx" to="~/userPage.aspx?pagename=${subdomain}&defaultpage=yes" processing="stop"/> <!--<rewrite url="~/Default.aspx" to="~/Default.aspx" processing="stop"/>--> </if>
</pre>
<pre lang="css">when i test website with this address everything is good: http://www.sub1.mysite.com/coHome.aspx
But when i want to test this address: http://www.sub1.mysite.com
doenst work rewrite</pre>
|
|
|
|
|
Im writing this code for display data in excel,
try
{
string Path = "G:\\AjanceReport\\TotalReportExcelfile_" + DateTime.Now.Day.ToString() + "_" + DateTime.Now.Month.ToString() + ".xls";
FileInfo FI = new FileInfo(Path);
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWriter);
DataGrid DataGrd = new DataGrid();
DataGrd.DataSource = dsGrid;
DataGrd.DataBind();
DataGrd.RenderControl(htmlWrite);
string directory = Path.Substring(0, Path.LastIndexOf("\\"));// GetDirectory(Path);
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
System.IO.StreamWriter vw = new System.IO.StreamWriter(Path, true);
stringWriter.ToString().Normalize();
vw.Write(stringWriter.ToString());
vw.Flush();
vw.Close();
WriteAttachment(FI.Name, "application/vnd.ms-excel", stringWriter.ToString());
}
catch (Exception ex)
{
//throw new Exception(ex.Message);
}
but i see this error : exception of type 'system.outofmemoryexception' was thrown
any body know what can i do???
|
|
|
|
|
Hey,
How many records do you have in your excel file?
Are they too much, I mean System.OutOfMemoryException hits when there is not much memory left for the application?
have a look at your excel and see whether you can optimize it..
-Anurag
|
|
|
|
|
hey frends i want to make a page that contain information about one product
name
photo
price
i want to make a page from where admin will login and edit this items
dynamic lab
|
|
|
|
|
Cool.
Do You have a question?
David
|
|
|
|
|
|
You can use asp.net login controls for creating login page. Use repeater or datagrid to display product list.
Or
Use default asp.net template.
Code is important, but it's a small part the of overall process.
Jagz W
|
|
|
|
|
Can anyone provide me a image locking ideas i don't want to allow user to copy my website image
-ank
|
|
|
|
|
Bad luck for you: that's technically not feasable. Every image you show on your pages must be "visible" to the browser, and then the browser can save it locally.
|
|
|
|
|
Ya i searched a lot found a solution you can not prevent a browser to save image and once browser have saved it you can not do any thing
-ank
|
|
|
|
|
Can't stop the copy, but how about applying a watermark on the image so it would be useless to anyone else.
|
|
|
|
|
ya excellent idea man i just got a blink on mind and i have started doing that thanks for your suggestion
-ank
|
|
|
|
|
Hi ALL,
I have folder in Server which contains some images. On page load I need to get the images and display them.
Can any one help mw how can I solve this
Thanks,
Siddiqali
|
|
|
|
|
You have to make a path to your folder, and use DirectoryInfo and FileInfo to Get the contents of the folder into the fileinfo object.
Then loop through fileinfo, and run a filter on the extension to pick out the images, plus filter out the other junk in the folder, like thumbs.db.
Dim fb_LibraryPath As String = Nothing
fb_LibraryPath = Context.Server.MapPath("\Product\images\Library\thumbs\")
Dim diFiles As DirectoryInfo = New DirectoryInfo(fb_LibraryPath)
Dim fileInfo() As FileInfo = diFiles.GetFiles("*.*", SearchOption.TopDirectoryOnly)
If fileInfo.Length() > 0 Then
For idx As Integer = 0 To fileInfo.Length() - 1
Dim fileName As String = fileInfo(idx).Name
If Not fileName.ToLower = "thumbs.db" Then
'Create a image element by code and set the src
End if
next
|
|
|
|
|
Code To upload Your Image to folder
YourFunctionToUploadImage()
{
if (ImageFileUploadControll.HasFile)
{
string fileExtention = System.IO.Path.GetExtension(ImageFileUploadControll.FileName);
if (fileExtention.ToLower() != ".jpg" && fileExtention.ToLower() != ".jpeg" && fileExtention.ToLower() != ".png")
{
lblUploadstatus.Text = "Invalid File Choose .jpg/.jpeg/.png/.gif";
}
else
{
if (File.Exists(Server.MapPath("~/Folder_Name/" + ImageFileUploadControll.FileName)))
{
lblUploadstatus.Text = "File Already Exists. Rename filename";
}
else
{
ImageFileUploadControll.SaveAs(Server.MapPath("~/Folder_Name/" + ImageFileUploadControll.FileName));
lblUploadstatus.Text = "Upload Status : File Uploaded Successfully";
}
}
}
else
{
lblUploadstatus.Text = "Please Select File";
}
}
Code To Retrive Images form Folder
PageLoadEvent()
{
DirectoryInfo dir = new DirectoryInfo(Server.MapPath("~/Folder_Name/"));
FileInfo[] fi = dir.GetFiles();
foreach(FileInfo f in fi)
{
string imageUrl = f.ToString();
Image img = new Image();
img.ImageUrl = "~/Folder_Name/"+"imageUrl";
}
}
Hope This Help
Pratik M. Bhuva
|
|
|
|
|
Hi Bhuva,
Thank you very much for your imp info. I am able to upload and get images, but while showing the images it takes long time. I have almost 150 images in the folder which I need to show with in no time. Request you to pls help me in solving this issue
Thanks,
Siddiqali
|
|
|
|
|
You can use ajax update pannel for fast image loading.
|
|
|
|
|
Code To Upload Image
//check whether FileUpload control has file or not
if (FileUpload1.HasFile)
{
string fileExtension = Path.GetExtension(FileUpload1.FileName);
if (fileExtension.ToLower() != ".jpg" && fileExtension.ToLower() != ".jpeg")
{
lblMessage.Text = "Only File With .jpg and .jpeg Extension are allowed";
lblMessage.ForeColor = System.Drawing.Color.Red;
}
else
{
if (File.Exists(Server.MapPath("~/Uploaded_Image/" + FileUpload1.FileName)))
{
lblMessage.Text = "Image Already Exist...Please Select Another Image";
lblMessage.ForeColor = System.Drawing.Color.Blue;
return;
}
else
{
FileUpload1.SaveAs(Server.MapPath("~/Uploaded_Image/" + FileUpload1.FileName));
lblMessage.Text = "File Uploaded Successfully";
lblMessage.ForeColor = System.Drawing.Color.Green;
}
}
}
else
{
lblMessage.Text = "Please Select File to be uploaded";
lblMessage.ForeColor = System.Drawing.Color.Red;
}
|
|
|
|
|
Hi everybody!!
I'm starting with asp.net and i would like to try my code online.. can you advise me some free hosting for asp.net with the possibility to use sql server?
Thanks
|
|
|
|
|
|
|
Hi,
In asp.net hosting using web services.
web services support IIS hosting only,
wcf supports IIS, WAS, SELF HOSTING
In asp.net a free hosting is possible
|
|
|
|
|
All programmers I m requesting please tell me how can i build my own online backup site using asp . net
http://www.codeproject.com/script/Forums/Images/coffee.gif
VICKY_ARYAN
|
|
|
|
|