|
can we display the thumbnail of image before inserting into database....
|
|
|
|
|
Why would you want to ? What is it that you're trying to do ? If you'd answer this question it might help me make a recommendation.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i want to display the uploaded image once i browse through fileupload control.. but before it is saved in database to check the image uploaded correctly or not..
|
|
|
|
|
You can't do that, because until it exists somewhere on your system, you can't send it back to the client. To send it back as a byte stream requires a seperate page or HTTP handler. It's just not possible.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
using http handler im getting image to a page..
im unable to get all the three images... only 1st image is displayed...
SqlDataReader dr = command.ExecuteReader();
dr.Read();
context.Response.BinaryWrite((Byte[])dr[0]);
cnn.Close();
context.Response.End();
Image1.ImageUrl = "handler3.ashx?staffID=" +
Session["staffid"].ToString();
|
|
|
|
|
I hv created cart dynamically at runtime through datatable............and i assigned it to the source of a datalist..............nw i want to edit quantity of products through datalist dynamically..........i tried many times.......but its not wrking properly.......this is my code.....
<br />
Dim dt As DataTable = Session("Cart")<br />
Dim dr As DataRow<br />
For i As Integer = 0 To DataList1.Items.Count - 1<br />
Dim txt As Integer = CType(DataList1.Items(i).FindControl("txtQty"), TextBox).Text<br />
Dim hf As Integer = CType(DataList1.Items(i).FindControl("hfatc"), HiddenField).Value<br />
Dim val As Integer = Convert.ToInt32(txt)<br />
For Each dr In dt.Rows<br />
If dr("ItemNo") = hf Then<br />
dr("ItemQty") = val<br />
Session("Cart") = dt<br />
DataList1.DataSource = dt<br />
DataList1.DataBind()<br />
lblTtl.Text = "Rs." & GetItemTotal()<br />
End If<br />
Next<br />
Next<br />
plz tell me.........where i m lacking behind.............is there any other way to do it.........
plz guide me a bit.........
|
|
|
|
|
KhandelwalA wrote: Dim dt As DataTable = Session("Cart")
Putting a datatable into the session seems wasteful to me.
KhandelwalA wrote: For i As Integer = 0 To DataList1.Items.Count - 1
Does this work ? In C# it would miss the last item.
KhandelwalA wrote: Session("Cart") = dt
Every time ? Why on earth are you doing this inside the loop ?
KhandelwalA wrote: DataList1.DataSource = dt
DataList1.DataBind()
Wow - again, this is very wasteful.
KhandelwalA wrote: is there any other way to do it.........
There's much better ways to do this. How about storing an id in the session and storing the cart in the database ? Then you could modify the cart with SQL, for a start.
KhandelwalA wrote: Dim txt As Integer = CType(DataList1.Items(i).FindControl("txtQty"), TextBox).Text
KhandelwalA wrote: Dim val As Integer = Convert.ToInt32(txt)
What are you writing this for ? Is it actually going to be used for anything ? By whom ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
Need a regular expression for Password Policy Validation...
The Password Policy should allow the contents mentioned below.
1. Password should be minimum of 9 characters in length
2. It should contain four characters [choose from a-z, A-Z]
3. It should contain four digits [choose from 0-9]
4. It should contain exactly one special character
[choose from #, @, $, !, underscore( _ ), hyphen (-), dot(.)]
Examples of correct passwords:
wxyz$6789 or a1b2#c3d4
Please help and Suggestions are welcomed.
Thanks in advance.
|
|
|
|
|
suravi wrote: Suggestions are welcomed.
Download Expresso, or buy a book on regular expressions.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
|
hi,
I need to implement search query in asp web form using c-sharp. I have taken a textbox control "txtSearch" and want to have search query through Google search engine.
|
|
|
|
|
|
no..its not like that i wanted
in web form , i've taken one textbox "txtSearch" and one button "btnSearch"..
When anyone searches some text by writing text to be searched in the txtSearch , then by clicking on the btnSearch ,it must automatically directs to google search.
|
|
|
|
|
What have you tried ? Just doing a couple of google searches should tell you the syntax to redirect to google with a search query. What is the problem ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Hello all,
I have an asp.net page uploading a file to D driver. It works well with ASP.NET server.
<br />
protected void Button6_Click(object sender, EventArgs e)<br />
{<br />
FileUpload1.SaveAs("D:\\a.txt");<br />
}<br />
when I published (to IIS) and ran it from IE, it caused an error: Access to the path 'D:\a.txt' is denied as following.
<br />
[UnauthorizedAccessException: Access to the path 'D:\a.txt' is denied.]<br />
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +651<br />
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +1038<br />
System.IO.FileStream..ctor(String path, FileMode mode) +64<br />
System.Web.HttpPostedFile.SaveAs(String filename) +87<br />
System.Web.UI.WebControls.FileUpload.SaveAs(String filename) +22<br />
Examples.Button6_Click(Object sender, EventArgs e) +20<br />
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105<br />
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107<br />
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7<br />
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11<br />
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33<br />
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746<br />
<br />
Best regards,
P/S:
The code for this problem is here:
I have an ASP.NET and this is the code in default.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button6" runat="server" önclick="Button6_Click" Text="Button" />
<br />
<br />
</form>
</body>
</html>
And here is the code into default.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button6_Click(object sender, EventArgs e)
{
FileUpload1.SaveAs("D:\\a.txt");
}
After compiling the project, I published it as following:
clicked right mouse on it and selected "Publish Website". Then I copy published files to a folder example (a subfolder of C:\Inetpub\wwwroot). Finally, I ran IE and fill in the address: http://localhost/example/default.aspx, clicked button_6, and got the error.
I installed IIS on my local computer with version v5.1
Thanks,
modified on Tuesday, November 3, 2009 4:24 AM
|
|
|
|
|
Does D: Drive exist on your server? Is it writeable, or is it a CD Drive? Do you have permissions to write to the root of D: Drive? Does your IIS process user have permissions to write to the root of D: Drive?
|
|
|
|
|
Yes, D: Local Drive exists on my computer.
I do not know whether I have permissions to write or not, but when I run the page using ASP.NET Server, It works well. After I published and then used IIS Server, It threw the error.
I do not know how to check permissions both the root of D: Drive and IIS process, and I need your help.
Thanks,
|
|
|
|
|
I'm a beginner wrote: Yes, D: Local Drive exists on my computer.
Your computer is the server ?
I'm a beginner wrote: I do not know how to check permissions both the root of D: Drive and IIS process, and I need your help.
A website should not have permission to read or write above the application root, so even if you have a D drive on your server, I'd expect this not to work.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
No, D: is my Local Drive and my computer is not a server. I have that project on my personal computer.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button6" runat="server" onclick="Button6_Click" Text="Button" />
<br />
<br />
</form>
</body>
</html>
And then I have an event to fileUpload1 Control:
protected void Button6_Click(object sender, EventArgs e)
{
FileUpload1.SaveAs("D:\\a.txt");
}
I ran the project from virtual server of ASP.NET, it worked well.
But when I published it to IIS server, it threw that error.
Thanks,
|
|
|
|
|
I'm a beginner wrote: No, D: is my Local Drive and my computer is not a server. I have that project on my personal computer.
So your computer IS where IIS is running, and therefore is the server, right ?
I'm a beginner wrote: But when I published it to IIS server, it threw that error.
Published it how ? Is IIS running on your local machine ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
He Still Did'nt get Your answer..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Christian Graus wrote: So your computer IS where IIS is running, and therefore is the server, right ?
Yes, I installed IIS into Windows XP on my personal computer.
Christian Graus wrote: Published it how ? Is IIS running on your local machine ?
Yes, IIS is running on my local machine. After creating a ASP.NET project in Visual Studio 2008 and writing code as I mentioned above, then I compiled the project, clicked right mouse on it and selected "Publish Website". Then I copy published files to a folder example (a subfolder of C:\Inetpub\wwwroot). Finally, I ran IE and fill in the address: http://localhost/example/default.aspx, clicked button_6, and got the error.
Thanks,
|
|
|
|
|
Do you not want our help now ? If you'd just answer my question, I could help you
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|