|
You might want to try giving the gridview a cssClass, then in the stylesheet
Code:
.SomeGridView a {color:#000000;}
.SomeGridView a:hover {color: #ff00000;}
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
You can set the style to the element which is available in content page. Normally, there is at least one DIV in content page. so, you can set the style to this div.
Hope it helps.
|
|
|
|
|
The content page itself is not rendered as an html element, so you can't set any style on the content page at all.
You have to set the color on an element outside the content tag (in the master page) or inside the content page.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
How to use SQL Query in JavaScript in ASP.Net?
If this is not possible can you suggest me on alternate plss
Thank you
|
|
|
|
|
Try to use ajax instead of this.That will be more easy.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
I have used AJAX but while calling that function its showing error
below is my code
<Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)> _
Public Function mfn_Deliverer(ByVal strWeight As String, ByVal strShipMode As String, ByVal strDelivere As String) As String
strsql1 = " SELECT postal_rate " & _
" FROM t_master_postalRates where '" & strWeight & "' >=wt_from " & _
" AND '" & strWeight & "' <=wt_to and shipMode_id='" & strShipMode & "'" & _
" AND deliverer_id='" & strDelivere & "'"
Dim dt As New DataSet
dt = CreateDataset(sqlCn, CommandType.Text, strsql1)
dim strPostageCharges as string=""
If dt.Tables(0).Rows.Count > 0 Then
strPostageCharges = IIf(IsDBNull(dt.Tables(0).Rows(0)("postal_rate")), 0, dt.Tables(0).Rows(0)("postal_rate"))
End If
Return strPostagecharges
End Function
JavaScript
function CheckDeliverer()
{
var Weight,Shipmode,Deliverer;
var PostalCharge;
if(isNaN(document.getElementById("txtPackingcharges").value)||document.getElementById('txtPackingcharges').value=='')
{
Weight = 0.0;
}
else
{
Weight = document.getElementById("txtPackingcharges").value;
}
Shipmode=document.getElementById('ddlShipMode').options[document.getElementById('ddlShipMode').selectedIndex].value;
Deliverer=document.getElementById('ddlDelivery').options[document.getElementById('ddlDelivery').selectedIndex].value;
PostalCharge= Mailing_Mail_Order_Form.mfn_Deliverer(Weight,Shipmode,Deliverer)
if PostalCharge ==''
{
alert('Deliverer is not available');
}
else
{
document.getElementById('txtPostageCharges').value=PostalCharge;
}
}
|
|
|
|
|
Then your code is broken. Tell us the error you're getting and what you've done to try and fix it.
Is this the ASP.NET AJAX library you're using ? You shouldn't need a third party library for a basic call like this, is this the only reason your code is dependant on it ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
To add to what someone else said, AJAX is not just easier, it's the only way. javascript cannot talk to your database, even if it was visible to the client.
I suggest reading up on how ASP.NET works, so you understand the difference between the client and the server.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i have sucessfully created a login system that enables users to register and login using visual studion 2005. It works fautlessly on the local machine. However when i run it remotely i get an error. the details of the error are not displayed to me. It is obviously a problem with IIS configuration???? can anyone help please.
|
|
|
|
|
I have replied your message since long time back. Why do you re-post this message without replying to the original post?
RE: LOGIN SCRITP[^]
|
|
|
|
|
Hi.
I'm building a web page (ASP.NET in VB) that is displaying employee list. For each employee I need to include their availability status (I think it's called smart tag). This smart tag can be found on Instant Messenger or in Outlook Express beside person's name.
Now. Do I need to use smart tag for that or somehting else? Do I have to build it from scratch or I can reuse some objects in office? Not sure where to start. The 'smart tag' when clicked should show the menu (as it does in outlook/IM) with email, start IM, and user info, etc. If more explanation is needed please let me know.
I use VS 2003, framework 1.something
Please help. Thank you.
Alex.
|
|
|
|
|
Hello,
I am trying to have my web page check if the client has an activex control installed before loading the page. I want it to look for the Visio Viewer add-on. I tried to do a Try-Catch on loading a document and tried to check file existence but that either doesn't work or I am doing it wrong. Any help?
|
|
|
|
|
Is there anyone that can provide some assistance with this? I just want my ASP.NET page to look for an activeX control or associated DLL on the client machine. If it finds it, then it proceeds to load the diagram. If not, it redirects the client to the Visio Viewer installer located on the internal network (I don't want the client to go to Microsoft's website).
|
|
|
|
|
Hi, I just made a simple Web Page that communicates with a simple Web Service. Both work fine on my machine, but I can't seem to find the way to install them on another computer.
I even made a Web Setup Project, but it didn't help. I tried some stuff with the Default Web Site of IIS, as well as putting my files in the Inetpub/wwwroot directory, but it doesn't work.
Can any of you tell me the steps to install a Web Service and its Web page? Thank you very much!
|
|
|
|
|
You need to be more specific about what the problem is. Saying 'it doesn't work' isn't good enough. State what error you are getting and maybe someone will be able to help you.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I'm using a Multiview control to produce a tabbed display. I want the display to resize nicely so that when the browser viewport gets narrow, the tabs flow into rows. I'm putting two Panels in each View, one for the "tabs", one for the content. The mark-up looks something like:
<style>
.TabContainer
{
font-family: Arial, Sans-Serif;
font-size: 8pt;
width: auto;
margin-top: 4px;
padding-top: 6px;
background-color: azure;
}
.TabItemActive
{
border-top: 1px solid #f5f5f5;
border-left: none;
border-right: 1px solid #aaaaaa;
border-bottom: none;
text-decoration: none;
background-color: #bbbbbb;
text-align: center;
padding: 6px 2px 0px 2px;
vertical-align: top;
}
.TabItemInactive
{
border-top: 1px solid #f5f5f5;
border-left: 1px solid #f5f5f5;
border-right: 1px solid #aaaaaa;
border-bottom: none;
background-color: #d3d3d3;
text-align: center;
text-decoration: none;
padding: 6px 2px 0px 2px;
}
.TabItemInactive:hover
{
background-color: #808080;
}
</style>
<asp:multiview id="mvMain" runat="server" activeviewindex="0">
<asp:view id="View1" runat="server">
<asp:panel id="PanelNavView1" cssclass="TabContainer" runat="server">
<asp:label id="lblView1" runat="server" cssclass="TabItemActive" text="Tab for View1"></asp:label>
<asp:linkbutton id="lbView2FromView1" cssclass="TabItemInactive" runat="server"> Tab for View2 </asp:linkbutton>
<asp:linkbutton id="lbView3FromView1" cssclass="TabItemInactive" runat="server"> Tab for View3 </asp:linkbutton>
<asp:linkbutton id="lbView4FromView1" cssclass="TabItemInactive" runat="server"> Tab for View4 </asp:linkbutton>
<asp:linkbutton id="lbView5FromView1" cssclass="TabItemInactive" runat="server"> Tab for View5 </asp:linkbutton>
<asp:linkbutton id="lbView6FromView1" cssclass="TabItemInactive" runat="server"> Tab for View6 </asp:linkbutton>
</asp:panel>
<asp:panel id="panelView1" runat="server">
This is the content for view 1
</asp:panel>
</asp:view>
<asp:view id="View2" runat="server">
.
.
.
</asp:view>
</asp:multiview>
The "tabs" look fine when they are displayed side-by-side. When the "tabs" flow into rows of "tabs", the issue I am having is that unless I take away all border-top and padding-top from the Label and LinkButton controls, the "tabs" in the bottom row partially cover the "tabs" in the top row.
Adding a top or bottom margin has not helped me nor has a number of other stabs in the dark. I'm a relative newbie to CSS/styling but I suspect my problem has something to do with the LinkButtons being converted to anchors <a> in the page that is output.
Can anyone lend a hand?
TIA
gibby</a>
|
|
|
|
|
I've set up a virtual directory on my machine to host a sample website I created. How would others be able to access my page. http:\\VirtualDirectoryAlias\ ???
I am locally able to view it. http:\\localhost\VirtualDirectoryAlias\
|
|
|
|
|
Others on the same network (and you yourself) should be able to see it by replacing "localhost" with your computer's name. You may need to configure your network/OS firewall to allow HTTP requests.
|
|
|
|
|
I have a datagrid containing 2 coulmns with 1 TextBox in each.
On the first TextBox I have a TextChanged event.
After the event is fired I want to set Focus on the next textBox, and sellect the text on it.
<br />
private void OnSubscriptionToValueChanged(object sender, System.EventArgs e)<br />
{<br />
TextBox tb = (TextBox)sender;<br />
if (tb.Text.Trim() != "VAT")<br />
{<br />
tb.CssClass = "tbStyle0";<br />
DataGridItem dgi = (DataGridItem)tb.Parent.Parent;<br />
TextBox tbToFocus = (TextBox)dgi.FindControl("tbNextValue");<br />
tbToFocus.Focus();
}<br />
else<br />
{<br />
tb.Focus();
tb.CssClass = "tbStyleError";<br />
}<br />
}
The code over sets Focus on the control I want, but it don't select the text (as it would if the TextChanged event
wasen't there when you tab from one TextBox too another).
Has anyone an idèe how to do that?
Thanks
Thomas
|
|
|
|
|
Page.RegisterStartupScript("focus", "<script>document.getElementById('" + tbToFocus.UniqueID + "').focus();</script>");
Page.RegisterStartupScript("select", "<script>document.getElementById('" + tbToFocus.UniqueID + "').select();</script>");
|
|
|
|
|
Visual Studio 2005 says that the function is absolite, so one should rather use:
Page.ClientScript.RegisterStartupScript(GetType(), "focus", "<script>document.getElementById('" + tbToFocus.UniqueID + "').focus();</script>");<br />
Page.ClientScript.RegisterStartupScript(GetType(), "select", "<script>document.getElementById('" + tbToFocus.UniqueID + "').select();</script>"); <br />
Thomas
|
|
|
|
|
And to expand on your solution. You should just strip off the <script> tags and add a fourth parameter with the value of true. This will ensure that the <script> tags are added automatically with the type attribute of the tag set to text/javascript which will make the output XHTML compliant.
Page.ClientScript.RegisterStartupScript(GetType(), "focus", "document.getElementById('" + tbToFocus.UniqueID + "').focus();", true);<br />
Page.ClientScript.RegisterStartupScript(GetType(), "select", "document.getElementById('" + tbToFocus.UniqueID + "').select();", true);
Kelly Herald
Software Developer
|
|
|
|
|
hi
I want to redirect the user to a mobile form when the requesting machine is a mobile irrespective of whether it has Pocket IE or some really ordinary browser.
<br />
Dim res As String = Request.Browser("IsMobileDevice")<br />
If res = "false" Then<br />
'when its a desktop machine requesting the page<br />
Response.Redirect(when_Desktop)<br />
Else<br />
'when its a mobile<br />
Response.Redirect(when_Mobile)<br />
End If<br />
Later I tried this code but it failed. I think HTTP headers help u to identify the model of the mobile. I just wanna know whether its a mobile or not.
How can I do it?
Thanks
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Failed how?
Check here[^] for how to call this correctly.
|
|
|
|
|
i am using vs 2005 . i am a beginer.i want to upload a file. i have a file upload control and a upload button .when clicking upload button file shud be uploaded and should get a message in a label.how to do ity? pls help.
"I am burning...the only thing rest in me is you..."
|
|
|
|