|
Hi,
Assume ID for your datalist control is dlist.
Then
string szChandu = (dlist.Items[i].FindControl("Label1") as Label).Text;
should work.
Please note i in the above code is the ith row of the datalist.
Regards,
Cybernate
|
|
|
|
|
Hello,
I am trying to use a multiline textbox in asp.net that will automatically move with the browser as it is resized both horizontally and vertically. I have tried using CSS and percent See Example Below:
***************************************************************************************
<asp:textbox id="txtInfo" runat="server" height="20%" textmode="MultiLine" xmlns:asp="#unknown">
Width="99%" Wrap="False" Font-Bold="False" Font-Names="Courier New"
Font-Size="Medium">
***************************************************************************************
I have also tried using java script
***************************************************************************************
// Subscribe to the onresize window event
window.onresize = Resize;
// Resize the textbox
Resize('txtInfo');
// Resizes the supplied textbox name
function Resize(textBox) {
// Get height - take margins into consideration
var height = parseInt(document.body.clientHeight) - (parseInt(document.body.currentStyle.marginTop) + parseInt(document.body.currentStyle.marginBottom));
// Get width - take margins into consideration
var width = parseInt(document.body.clientWidth) - (parseInt(document.body.currentStyle.marginLeft) + parseInt(document.body.currentStyle.marginRight));
// Set the textbox height and width
if (textBox != null) {
document.getElementById(textBox).height = height;
document.getElementById(textBox).width = width;
}
}
***************************************************************************************
Anyone who can provide me with a little direction would be greatly appreciated!!!
Thanks
Ryan
|
|
|
|
|
Just set
Width = 100%
and
Height = 100%
of a textbox. and its done. dont forget to put the text box inside the < div > or < table > tag which also has width = 100% .
So I think your code is ok, no need to use java script just make sure that all the containers of that text box are set to 100% width.
|
|
|
|
|
Okay, I tried this (I included the whole page as it is not too much) This code is auto generated by Visual Studio 2008.... The text box resizes by width, but not by height. (I had to remove all greater than and less than's so it would display in the post correctly)
Thanks for your Time
Ryan
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="WebRaceReport.aspx.vb" Inherits="_Default" %>
<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>
html xmlns="http://www.w3.org/1999/xhtml"
head runat="server"
title Untitled Page /title
/head
body background="App_Data/Mud2.jpg"
form id="form1" runat="server"
div style="font-size: xx-large; font-weight: bolder; position: fixed; width: 100%; text-align: center"
asp:label id="lblReports" runat="server" font-size="XX-Large" text="REPORTS" xmlns:asp="#unknown">
/div
p
/p
p
asp:dropdownlist id="cmbRaceDates" runat="server" autopostback="True" xmlns:asp="#unknown"
/asp:dropdownlist
asp:dropdownlist id="cmbRaceClass" runat="server" autopostback="True" xmlns:asp="#unknown"
/asp:dropdownlist
asp:dropdownlist id="cmbRaceReport" runat="server" autopostback="True" xmlns:asp="#unknown"
/asp:dropdownlist
/p
p
/p
div id="TxtBoxDiv" style="height: 100%; width: 100%;"
asp:textbox id="txtRiderInfo" runat="server" height="100%" textmode="MultiLine" xmlns:asp="#unknown"
Width="100%" Wrap="False" Font-Bold="False" Font-Names="Courier New"
Font-Size="Medium">
asp:textbox
/div
/form
/body
/html
modified on Monday, March 23, 2009 11:01 PM
|
|
|
|
|
OK. This is odd problem because of soo many browsers we have. every browser render the page differently, so its very difficult to make height 100% in all the browser.
You need to set margin and padding to 0 to avoid scroll bars, if scroll bars are visible, you will not able to get 100% height. also in IE you can use min-height : 100%; .
try this in < style > tag
*
{
margin: 0;
padding: 0;
}
html
{
height: 100%;
}
body
{
height: 100%;
}
or you can just set the Rows of multi line text-box to like 150 or something, or you can modify your java script to change the Rows based on Page height.
I am not sure if this will work in all the browsers.
|
|
|
|
|
I am still having no luck. I have set an HTML style overflow: hidden; clip: rect(0px, 0px, auto, auto); margin: 0px; padding: 0px; width: 100%; height: 100%; min-height: 100%;
The Form has a style:
style="margin: 0px; padding: 0px; width: 100%; height: 100%; overflow: hidden; position: relative; top: 0px; left: 0px;">
The Div that contains the textbox has a style
style="margin: 0px; padding: 0px; height: 100%; width: 100%; position: relative; overflow: hidden;">
The text box is set up:
<asp:textbox id="txtRiderInfo" runat="server" height="100%" textmode="MultiLine" xmlns:asp="#unknown">
Width="99%" Wrap="False" Font-Bold="False" Font-Names="Courier New"
Font-Size="Medium" ReadOnly="True" Rows="100">
Unless I set the rows to a large number, the textbox stays small.
With all the years the web has been around, why are the amount of controls and the abilty to make them behave so difficult??
This is a 10 second problem to fix in Java apps, VB6, VB.net, C#......
I do appreciate your help, just can't believe the solution is so complicated.......
Ryan
|
|
|
|
|
Yes thats true. Thatswhy I dont want anymore browsers, because they all follows their own standards for rendering. I think IE8 and FF3 are more standard based. IE6 / IE7 / Safari / Opera have their own rules. so its very difficult to follow. Many developers has more then one .css files for different browser. they detect browser at the index page and then apply the stylesheet based on that.
Thanks.
|
|
|
|
|
Hi,
I am trying to debug a web service that is running on a remote machine.
When I try to "step into" a web method I get the following error: "Unable to automatically step into the server. The remote procedure could not be debugged. This usually indicates that debugging has not been enabled on the server".
I have checked the compilation setting in the web.config file and it is definitely set to debug.
I did notice, however, that there is no PDB file for the App_Code.dll
Visual Studio is seemingly supposed to put the PDB file in the BIN folder when the web service is compiled but this doesn't happen when I compile it.
Can anyone tell me if I do in fact need the PDB file to debug remotely and, if I do, where should I look for it when I compile.
Thanks,
dlarkin77
|
|
|
|
|
After quite a bit of digging around I stumbled across the aspnet_compiler tool. Using this I was able to generate teh PDB files.
Thanks,
dlarkin77
|
|
|
|
|
Hi,
I want to implement Save As Dialog Box Asp.Net Application but there is no specific save dialog file and open dialog file in toolbox. I tried the following code to open Save as Dialog box
Response.ContentType = "image/jpeg";
Response.AppendHeader("Content-Disposition", "attachment; filename=image.jpg");
Response.TransmitFile(Server.MapPath("~/images/"));
But in this I am specifying specific file to save but i need to enter the file name dynamically by the user to save it in specified path.
Can anyone please help me how to resolve this problem.
Thanks in Advance
Pavani
|
|
|
|
|
means ASP.NET from browser... Its not possible..
|
|
|
|
|
Why you are trying to do so? Client Browser will give him a message for save/open/Run etc... and if clicks on Save, it will save it to default Download location that already set by the user.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Hello i'm also trying to do the same on "button click" it should ask for physical path to save!
please help
|
|
|
|
|
Hi,
how i write a function or method which return table row with 32 cells any help.
Best Regards
|
|
|
|
|
What kind of table do you mean? Database-table? Html-table? Asp-table?
|
|
|
|
|
Hey you mean how to return a DataTable from one function????
Whats the problem. Are you using Web service to return... or Remoting. ?
|
|
|
|
|
Hi,
i did coding like below but it is not working second i want to use table server control not the html table control.
HtmlTable tb = new HtmlTable();
tb.Rows.Add(Row32Cell());
private HtmlTableRow Row32Cell()
{
HtmlTableRow tr = new HtmlTableRow();
for (int i = 0; i < 32; i++)
{
tr.Cells.Add(new HtmlTableCell());
}
return tr;
}
Hope it clears to you any help.
Best Regards
|
|
|
|
|
Rameez Raja wrote: i did coding like below but it is not working
What is not working? The code snippet you have given seems to work fine...what is the problem you are facing?
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Spunky Coder wrote: What is not working? The code snippet you have given seems to work fine...what is the problem you are facing?
Nothing is displaying on Page i mean may i add some thing like HTMl table control to page ?
Best Regards
|
|
|
|
|
Ok...You need to place a Table control in your webpage...
Use the following in your .aspx page
Now in the code behind you can add rows to the table
Table1.Rows.Add(Row32Cell());
private HtmlTableRow Row32Cell()
{
HtmlTableRow tr = new HtmlTableRow();
for (int i = 0; i < 32; i++)
{
tr.Cells.Add(new HtmlTableCell());
}
return tr;
}
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
In my web page I want that user can choose a background color from the existing list and for that user the background color should remain same.until he change it.Means for each user background color may be different according to their choice.
Thanx in advance.
|
|
|
|
|
why dont you store the value in the database just corresponding to the userdata and load accordingly when user logs in.
This is the same thing that we do, when we are working with themes which are customizable in runtime,.
|
|
|
|
|
All,
We have an Asp.net application (C#) that selects the streets of a certain municipality.
It works very well except when we choose one certain municipality. Then it gives an error.
the error message says: "Not a valid bookmark". If I copy the sql query in a winform application with the same provider the query return the correct data.
We're working with OleDb and and an access database with the Jet 4.0 provider.
I searched google and MSDN, but it didn't give me anything useful.
All ideas are welcome.
thanks a lot.
|
|
|
|
|
may be the string that is used in where clause buggy because of Data..
I dont know..
May be if you could write what query you are running, and the data of the municipality you are using, we can help
|
|
|
|
|
hey, thanks for answering, but in meantime I found the problem. the database was corrupt. I replaced it with a copy and the query went right through...
|
|
|
|