Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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
 
Old September 7th, 2007, 09:09 AM
Authorized User
 
Join Date: Jun 2007
Location: hyderabad, AndhraPradesh, India.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hello!

Hi friends,
Can any one help me to design this below application.

I want to give a html string to create a table in a text box as a input.(<table>.........</table>).
depending on the string the it must read it and display the table for me.


cheers
ossy!
__________________
Surya!
 
Old September 7th, 2007, 09:54 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Ossy!!
Offcourse it is possible,do u want to store this value in database or only need to display at client side.
Please give more details abt it.
Also ,one request to you ,plz put proper subject ,for others wht does "Hello!" means? ,this is because it helps a person looking on the subject can give ur answer quickly,otherwise i have no issue.
well i provide the code
plz also mention on which technology u r looking code asp/aspx or php etc


Cheers :)

vinod
 
Old September 7th, 2007, 02:08 PM
Authorized User
 
Join Date: Jun 2007
Location: hyderabad, AndhraPradesh, India.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hye thanx vinod!
I want the code in aspx.
Sorry for the subject.Next time i shall watch out.

thanx again.
cheers,
Ossy!
 
Old September 7th, 2007, 02:11 PM
Authorized User
 
Join Date: Jun 2007
Location: hyderabad, AndhraPradesh, India.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey by the way i want to store the values in database as well.

cheers,
Ossy!
 
Old September 8th, 2007, 03:15 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Ostwald!!
I am just going to show a small demo,u can store the textbox value into the database ,
you must take care abt single ,double and special characters
you can save the text value into the database and retrieve it.
My demo is based on javascript,plz change it in aspx code.
<script>
function loadTbl()
{
str=document.getElementById("input1").value
document.getElementById("div1").innerHTML=str
}

</script>

<input type=text id="input1" size=1000 value="<table bgcolor='red' border=1 ><tr><td>testing1</td><td>tmp1</td></tr><tr><td>testing2</td><td>tmp2</td></tr></table>" >
<input type=button value=showTbl onclick="loadTbl()">
<div id="div1">
</div>

Cheers :)

vinod
 
Old September 11th, 2007, 11:28 PM
Authorized User
 
Join Date: Jun 2007
Location: hyderabad, AndhraPradesh, India.
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey vinod,
Thanx for the help. I got this thing perfectly now.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" ValidateRequest="false" %>
<%@ Import namespace="System.Text" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<script language="C#" type="text/C#" runat=server >
private void Post_Text(object sender, EventArgs e)
{

if(mess.Text!="")

postmess.Text=mess.Text ;
String s = "Select * from htmln";
SqlConnection con = new SqlConnection("Data Source=KIRAN;Initial Catalog=TrylahNewLayout;Persist Security Info=True;User ID=sa;Password=sa123");
SqlDataAdapter da = new SqlDataAdapter(s,con);
SqlCommandBuilder cb = new SqlCommandBuilder(da);
DataSet ds = new DataSet("htmln");
da.Fill(ds, "htmln");

DataRow row = ds.Tables["htmln"].NewRow();
row["doc"] = postmess.Text;
ds.Tables["htmln"].Rows.Add(row);
da.Update(ds, "htmln");



}
}

public string parsetext(string text, bool allow)
{

StringBuilder sb = new StringBuilder(text) ;

sb.Replace(" "," &nbsp;");

if(!allow)
{

sb.Replace("<","&lt;") ;
sb.Replace(">","&gt;") ;

sb.Replace("\"","&quot;");
}

StringReader sr = new StringReader(sb.ToString());
StringWriter sw = new StringWriter();

while(sr.Peek()>-1)
{

string temp = sr.ReadLine();

sw.Write(temp+"<br>") ;
}

return sw.GetStringBuilder().ToString();
}
</script>
<body>
<center>
<br>
<form runat=server ID="Form2">
<table border=1 style="font-family: Franklin Gothic Medium">
<tr>
<td valign=top>Result</td>
<td>
<asp:label text="&nbsp;" id=postmess runat=server Width="68px" />
</td></tr>
<tr><td valign=top>Enter Message </td>
<td><asp:textbox Columns="50" Rows="20" TextMode="MultiLine" id=mess runat=server /></td></tr>
<tr><td colspan=2 style="height: 28px"><asp:button onClick="Post_Text" text="Generate!" runat=server ID="Button1" /></td></tr>
</table>
</form>
</center>
</body>
</html>


Cheers,
Ossy!








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