Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 17th, 2006, 12:33 PM
Registered User
 
Join Date: Nov 2006
Location: Silves, Faro, Portugal.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default <img> from database... How??

yes, it's true, i appear to be dumb.
i've been looking around and cant understand/find how to store and retrive html tag ( and standard text) from and onto a database. i want to do pages where my father can just update is site, with no computer knowledge. Can anyone suggest where to start from? My main worry is how to display the image tag <img>, are here any examples outthere, can i do it with no or little code?

Thank you,
Paulo
  #2 (permalink)  
Old November 17th, 2006, 01:00 PM
Authorized User
 
Join Date: Nov 2006
Location: Bristol, TN, USA.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to davidrodrigues40
Default

I did something similar to this using the fileupload control. Save the file to a folder and place the file path and name into the database as the images url. Then place a gridview on the page and place an asp:image tag in the column/templaste with the imageurl bound to the returned url of the image. Let me know if this help or you need further assistance.

David Rodrigues
"There is no box"
  #3 (permalink)  
Old November 20th, 2006, 05:55 AM
Registered User
 
Join Date: Nov 2006
Location: Silves, Faro, Portugal.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your answer, but I think I didn’t explain myself right, what I need is a way to display html already stored on a database (as text) on an aspx.
The code would have been inserted on the database, using an online (WYSIWYG) html editor.
(He might want to use tables for positioning, images on diferent positions, etc...)
Thanks,
Paulo
  #4 (permalink)  
Old November 20th, 2006, 06:58 AM
Registered User
 
Join Date: Nov 2006
Location: Silves, Faro, Portugal.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok, nevermind, I got it... if I use:
<%@ Page Language="VB" AutoEventWireup="True" ValidateRequest="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    Sub SubmitBtn_Click(ByVal sender As Object, ByVal e As EventArgs)
        Span1.InnerHtml = "You wrote: <br />" + TextArea1.Value
    End Sub
</script>
<html >
<head>
   <title>HtmlTextArea Example</title>
</head>
<body>
   <form id="form1" runat="server" style="border-right: maroon thin dotted; border-top: maroon thin dotted; margin: 2px; border-left: maroon thin dotted; width: 250px; border-bottom: maroon thin dotted; height: 250px;">
      <h3>HtmlTextArea Example</h3>
      Comments: <br />
      <textarea rows="2" cols="20" id="TextArea1"
                runat="server"/>
      <br />
      <input id="Submit1" type="submit"
             value="Submit"
             onserverclick="SubmitBtn_Click"
             runat="server"/>
      <br />
      <span id="Span1"
            runat="server" style="" />
   </form>
</body>
</html>

I can get what i need, BUT i have to insert om the textarea : img src="images/image.jpg" (with the opening and closing < > ), I was trying to use ~/ or / before the image folder and forgoting to set ValidateRequest="false".
Well i hope this helps others, questions? post them. Thanks David, for the help.

Cheers,
Paulo


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
<img Tag problem> sen321x .NET Framework 2.0 1 October 30th, 2007 07:47 AM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
<STRONG> vs <B> and <EM> vs <I> anshul HTML Code Clinic 12 September 1st, 2004 05:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.