|
HI Experts,
The output of my code is not coming in tabular way,which i want to display it in table form..
already i have written code for that...
For referance please see the code below....
<br />
<br />
StringBuilder strHTMLContent = new StringBuilder();<br />
<br />
cmd = new SqlCommand("select * from Area ", sqlcon);<br />
sqlcon.Open();<br />
SqlDataReader odr = cmd.ExecuteReader();<br />
while (odr.Read())<br />
{<br />
strHTMLContent.Append("<table align='Center'>".ToString());<br />
strHTMLContent.Append("<tr>".ToString());<br />
strHTMLContent.Append("<td style='width: 300px'></td>".ToString());<br />
<br />
strHTMLContent.Append(odr["AreaId"].ToString());<br />
strHTMLContent.Append(odr["AreaCode"].ToString());<br />
strHTMLContent.Append(odr["AreaDesc"].ToString());<br />
<br />
<br />
strHTMLContent.Append("</tr>".ToString());<br />
strHTMLContent.Append("</table>".ToString());<br />
strHTMLContent.Append("<br><br>".ToString());<br />
}<br />
sqlcon.Close();<br />
<br />
strHTMLContent.Append("<p align='Center'> Note : This is dynamically generated HTML document </p>".ToString());<br />
<br />
<br />
HttpContext.Current.Response.Write(strHTMLContent);<br />
<br />
|
|
|
|
|
for lines where your dynamically adding the values of the database, use the ToString() method, but not for the literals:
rhtbhegade wrote:
strHTMLContent.Append("<table align='Center'>".ToString());
strHTMLContent.Append("<tr>".ToString());
strHTMLContent.Append("<td style='width: 300px'></td>".ToString());
should read:
strHTMLContent.Append("<table align='Center'>");
strHTMLContent.Append("<tr>");
strHTMLContent.Append("<td style='width: 300px'></td>");
Then at the very end of the once your datareader is finished, convert the string builder to a sting.
HttpContext.Current.Response.Write(strHTMLContent.ToString());
Hope this helps!
[update] You'll also want to inject the dynamic stuff inside the table data elements:
strHTMLContent.Append("<table align='Center'><tr>");
strHTMLContent.Append("<td style='width: 300px'>" + odr["AreaId"].ToString() + "</td>");
that's probably most likely why it's not coming out in the 'grid' form you were expecting.
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
modified on Friday, November 6, 2009 3:14 PM
|
|
|
|
|
Thanks Expert......very much.. 
|
|
|
|
|
rhtbhegade wrote: Thanks Expert......very much
You have to mark it as answer..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
hi
I got this code from googling
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.pstrength-min.1.2.js">
</script>
<script type="text/javascript">
$(function() {
$('.password').pstrength();
});
</script>
and css :
.password {
font-size : 12px;
border : 1px solid #cc9933;
width : 200px;
font-family : arial, sans-serif;
}
.pstrength-minchar {
font-size : 10px;
}
but function in script is not working
plz help....
|
|
|
|
|
bhavnvyas wrote: // adjust the path as is required
</blockquote>
Have You place the .js files in the specified folder..!
What r u trying to do..!
R u checking the min length of the password..!if so use Validator controls..!
<div class="ForumSig"><small>
LatestArticle :<a href="http://www.codeproject.com/KB/aspnet/ConfigureLog4net.aspx">Log4Net</a></small>
Why Do Some People Forget To Mark as Answer .If It Helps.</div>
|
|
|
|
|
hi sashidhar
no I am using this script for password strength.
path is ok but i think $ funcition () is not working....if possible can u plz explain me "$" thing........ 
|
|
|
|
|
AFAIK There isnt a code in there to work
What r u trying to do..! I can give other way to work
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I am using jquery for password strength meter in my app but function
.pstrength();
is not working....
my password field control:
<INPUT class="password" type=password name="Password">
|
|
|
|
|
|
|
i have to use java script password strength its our project req.... 
|
|
|
|
|
Give Me some time i will check the code its working or not
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
ok thnx for helping buddy...![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
try like this.
On the Head Section Above..!Add this..!
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.pstrength-min.1.2.js">
</script>
<script type="text/javascript">
$(function() {
$('.password').pstrength();
});
</script>
In Css Add the Following code..!
.password {
font-size : 12px;
border : 1px solid #cc9933;
width : 200px;
font-family : arial, sans-serif;
}
.pstrength-minchar {
font-size : 10px;
}
drag and drop the css page on the head section..!
add the following html
<asp:TextBox ID="Password" runat="server" CssClass="password"
TextMode="Password"></asp:TextBox>
Now In the solution Explorer create a folder js and paste the two .js files in the js folder
Now it will work..!
ALll the best..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
|
Any time..!
All the best..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
hi sashidhar
still not working I am using it in ascx page and this control in aspx page which inherites master page so my script tag is in master page ...... if u can thn help me otherwise i'll find other js control...
thnx again
![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
bhavnvyas wrote: g I am using it in ascx page
You have to add the Script tag in .ascx page not in master page
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
still not workin its working in my demo app in aspx page...
thnx buddy for helping so much.......![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
Just Paste the code in .ascx file
there is style sheet it had to your style sheet reference..!
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.pstrength-min.1.2.js">
</script>
<script type="text/javascript">
$(function() {
$('.password').pstrength();
});
</script>
<asp:TextBox ID="Password" runat="server" CssClass="password"
TextMode="Password"></asp:TextBox>
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
still not working....
thnx a lot...... ![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
k
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
|