|
Oh sorry. The top part is c#, and the bottom code block is javascript.
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
|
|
|
|
|
I have a listview that works fine but I would like to improve the appearance. Using codebehind, I insert textboxes into each listview cell. The cells are different colors. The space between the cells has gaps in the colors. Although the cells are grey, the space between two cells is white. I have tried tweaking borderstyle and bordercolor of the textbox but nothing changes.
I believe that my problem is caused by css. I took my html and browsed without the css file and things look different, so I will try to figure out what puts the gaps in.
But I would still like an answer for my amount fields.
I would also like a way to right align the currency fields within these textboxes. I can't get this to work well either.
Here is a portion of my code. I have bitmap image of the app but I can't insert this into my post.
Dim txtBox As New System.Web.UI.WebControls.TextBox
With txtBox
.BorderStyle = BorderStyle.None
.ReadOnly = True
.Text = " "
.BackColor = Drawing.Color.LightGray
.BorderColor = Drawing.Color.LightGray
End With
oRow.Cells(iCol).Control = txtBox
oRow.Cells(iCol).Control.Width = Unit.Percentage(100)
oRow.Cells(0).Control.BorderStyle = BorderStyle.None
The answer was found in this site.
.Style("TEXT-ALIGN") = TextAlign.Right.ToString()
I am not sure why there is a need for TEXT-ALIGN as well as ALIGN but my pages look much better now. The thing that I forgot is that webform controls are merely an aid to creating HTML. I need to understand the underlying HTML to make my site pleasing to the eye.
I appreciate any help on these issues.
modified on Monday, August 31, 2009 11:35 AM
|
|
|
|
|
i've set the property of edit in data gridview control..but why it is not working???The fields in my data gridview are databound....Any particular property i am missing?????????
|
|
|
|
|
How it is possible to find what you have missed without your coding
|
|
|
|
|
I dnt knw what code is to be written inside the row editing event...i had read in sme other article that just enabling the row_editing event will be sufficient....
Here my datasource is datatable..and the gridview rows are databound..is it needed to convert those rows to some controls like textbox to enable edit property?
|
|
|
|
|
For that Edit Property To Work .U need to use data source i.e. sqldatasource ,then it will work .Otherwise if u r binding data source programmatically then u need to use code and templates to databind u can the following link to do programmatically
GridView all in one[^]
|
|
|
|
|
There is a external css file with some classes and elements provided. I link it in the master page head section as from MSDN web sites templates:
<link href="themes/default/styles.css" rel="stylesheet" type="text/css" />
After I set in some button controls CssStyle to some of the css classes, in VS design view the style is changed but when the page is run, they are displayed without any styles applied.
How to link that stylesheet properly? or what is the problem
Чесноков
modified on Friday, August 28, 2009 8:42 AM
|
|
|
|
|
Style sheet design cant be seen in your design page . It will be applied only when the page gets executed. I don't know how to have seen the design of style sheet in your design view. Nothing wrong in your registration with the master page. Post more codes to get clarification.
|
|
|
|
|
In VS2008 there is addition of design view of your web page as it looks from the source, along with split, where you can watch both source code and the page look.
"Project.Master file"
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="GenderAge.master.cs" Inherits="GenderAge.GenderAge" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<link href="themes/default/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
"Page.aspx file"
<%@ Page Title="" Language="C#" MasterPageFile="~/Project.Master" AutoEventWireup="true" CodeBehind="Page.aspx.cs" Inherits="Page.Main" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:Button ID="buttonFileUpload" runat="server"
Text="Upload" CssClass="buttons" />
</asp:Content>
Чесноков
|
|
|
|
|
What does the output HTML look like?
What are you putting in the head place holder? Is the / missing from the end of <asp:content id="Content1" contentplaceholderid="head" runat="server"> due to a cut and paste issue or is it missing from your page as well?
|
|
|
|
|
yes, it misses in the paste operation here.
I do not put anything in the head place holder Content1. Should I?
After I created the App_Themes folder and put there css file the styles become visible after the page is started.
However there is difference between VS2008 design view and the actual page, e.g. marging and padding does not work in some div controls???
Чесноков
|
|
|
|
|
hi all,
i have html table with some data.......now i want collect the data from this html table and then send the all data to the server-side through page method.
My logic is that in for-loop collect all data from html table and put in hashtable and then add this hashtable in an arraylist and then send this arraylist to server side.
Can anybody solve my problem?
|
|
|
|
|
Hello every one i want to upload an image by file uploader and want to store path of the image in database .please guide me.how can i do this
|
|
|
|
|
Did you tried FileUpload control??
It will help you upload the file and then also give you its path, you can then save the path in database.
|
|
|
|
|
|
Hello All,
i have facing one problem
i have one check box like below
<asp:checkbox id="uxonechk" runat="server" enabled="false">
Now i want to Enabled = true in javascript not server side then how it possible i have try through below code but not woking please let me know how it possible.
like,
funcction enableAll()
{
var Checkbox = document.getElementById('<%=uxonechk.ClientID %>');
ConformOwnershipDropdown.disabled = false;
}
this above function i have call on dropdown "onChange" event
Please let me know how it possible to Enabled = true using Javascript
Thank you in advance,
Anish Patel
|
|
|
|
|
You need to enable checkbox.right?
try this in javascript,
Findout CheckBox as chk by getElementById and then,
chk.disabled = false;
chk.parentNode.disabled = false;
Let me know if any pblm is there.
|
|
|
|
|
Thanks, it's working
Anish Patel
|
|
|
|
|
<script language="javascript" type="text/javascript">
function ChkEnabled(){
var a = document.getElementById('<%=CheckBox1.ClientID %>');
a.disabled = false;
if(a.parentElement.tagName == 'SPAN' && a.parentElement.disabled == true)
a.parentElement.disabled = false;
}
</script>
HTH
|
|
|
|
|
Hi,
I am trying to add dynamic link button to data table. But get an full link class name.i.e.
System.Web.UI.WebControls.LinkButton
can any one tell me the way to do this?
Here is my code:
Dim dt As New DataTable()
Dim dr As DataRow
dt.Columns.Add("EventDate", Type.[GetType]("System.DateTime"))
dt.Columns.Add("EventHeader", Type.[GetType]("System.String"))
Dim lnk As New LinkButton
lnk.ID = InteractionClickId
lnk.Text = objDal.Name
dr = dt.NewRow()
dr("EventDate") = objDal.Date1
dr("EventHeader") = lnk
dt.Rows.Add(dr)
Regards...
Vijay Jain
"One thing you can't recycle is wasted time."
|
|
|
|
|
I haven't tried but don't this is possible.
What you want to achieve?
And we normally add controls to the page.
|
|
|
|
|
I m trying to use a modal popup extender, dynamically in my code in event calendar.
And event calendar is a 3rd party tool, I only have dll for that.
So I have to paas all data in data table to add in event calendar.
That's why I m trying to do this.
Regards...
Vijay Jain
"One thing you can't recycle is wasted time."
|
|
|
|
|
That event calendar control should have some databinding event?
You can handle that event and then use it to add controls to it.
HTH
|
|
|
|
|
Hi
I am having a GridView paging done using Object data source.
I want to calculate the sum of records of a column.
First I need to find out values if ID = 1 sum all IDS with 1, if ID=2 sum all IDS with 2 and Display. I am able to do it
but when i move to next page my label looses its value while rendering.
Inderjeet Kaur
Sr. Software Engg
|
|
|
|
|
Hi
I got teh solution for the problem. I am usin Update Panel which gives inconsistent behaviour while postback.
SO before closing Update Panel for gridView we need to give
this PostBack Trigger
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID ="gvInstitutionReport" />
</Triggers>
</asp:UpdatePanel>
Inderjeet Kaur
Sr. Software Engg
|
|
|
|