|
Hi
You can use this css code
ul#menu li a:Hover
{
background-color: #fff;
color: #000000;
}
I dont understand what you mean in this code
ul#menu li.<big>selected</big> a
{
background-color: #fff;
color: #000000;
}
I think that LI element does not have selecting capability
If you want to use Pseudo-class you should write like
ul#menu li:selected
but I am not sure that selected be a Pseudo-class
Mohammad Khansari
|
|
|
|
|
I stumbled over this too. In order to use the "selected" style for the tab in the standard MVC site.css file, you need to have the selected class be assigned to the <li> rather than the <a> tag.
ul#menu li.selected a
{
background-color: #fff;
color: #000000;
}
So to show the About item selected, for your menu use:
<ul id="menu">
<li><%= Html.ActionLink("Home", "Index", "Home")%></li>
<li><%= Html.ActionLink("Sites", "Index", "Sites")%></li>
<li class="selected"><%= Html.ActionLink("About", "About", "Home")%></li>
</ul>
|
|
|
|
|
I'm trying to migrate a web site to an azure application, and when I try to compile, it doesn't see the dropdown list controls on the web forms.
Why is that?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Dropdown Lists (and List Boxes) are windows forms controls sucked into the browser by Microsoftie magic. and (WAG) either won't be rendered the same way in Azure, or haven't been migrated yet.
|
|
|
|
|
Check this where Rodger[^] mention some of the issues which were absent in Development env.
I think there might be some weird behavior found by many of them after updating to Azure.
|
|
|
|
|
How do I print information displayed on a gridView or inside a panel for example with either server script or client script without printing the whole page.
I use window.print() method but the whole page is printed out, I don't want that. I want a specific region of my .aspx page.
Thank you all.
Tunsten
|
|
|
|
|
Hi
You can create a new window on client side.
var pp = window.open('', '', 'left=0,top=0,toolbar=0,scrollbars=1,status=1');
and use innerHTML property to insert print text or html
pp.document.body.innerHTML += cPrint;
after that use window.print() for new window
Mohammad Khansari
|
|
|
|
|
But I don't seem to get you write. I mean to print out specific area (maybe information displayed on a DIV tag for example) from the page.
Tunsten
|
|
|
|
|
hi
Here is complete code
var pp = window.open('', '', 'left=0,top=0,toolbar=0,scrollbars=1,status=1');
pp.document.body.innerHTML += cPrint;
pp.document.close();
pp.focus();
pp.print();
I think that it works properly
Mohammad Khansari
|
|
|
|
|
Hello everyone,
How do I get the ID of a server control with JavaScript code?
I am trying to do client-side validation with JavaScript before it's processed on the server, the code I used didn't work and I did't get error. Below is the code I used:
// the JavaScript function
function ValidateAssetCategory() {
var catID = document.getElementById("txtCatID").value;
if (catID == null) {
alert("Please enter category ID");
return false;
}
}
// the aspx source code
<asp:LinkButton ID="lbSave" runat="server" OnClientClick="ValidateAssetCategory();" onClick="lbSave_Click">Save</asp:LinkButton>
only the server code is executed.
Thanks for your understanding...
Tunsten
|
|
|
|
|
tunsten wrote: var catID = document.getElementById("txtCatID").value;
As you have said you need to get ID of Server Side Control, you have to do the following :
Var CatClientID="<%=txtCatID.ClientID%>"
function ValidateAssetCategory() {
var catID = document.getElementById(CatClientID).value;
if (catID == null) {
alert("Please enter category ID");
return false;
}
}
Hope this will help you.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I did it but the client script still didn't work. How I am I suppose to put the server script? I used
<asp:linkbutton id="lbSave" runat="server" onclientclick="ValidateAssetCategory();">Save
what other option please?
Tunsten
|
|
|
|
|
document.getElementById("<%=txtCatID.ClientID%>").value
|
|
|
|
|
then, how do I code the linkbutton?
is it
<asp:linkbutton id="lbSave" runat="server" onclientclick="ValidateAssetCategory()" onclick="lbSave_Click">
if it is, I have tried it but did not work. only the server script (lbSave_Click) is executed.
help me out.
Tunsten
|
|
|
|
|
Just replace
<asp:LinkButton ID="lbSave" runat="server" onClientClick="ValidateAssetCategory()" onClick="lbSave_Click" />
with
<asp:LinkButton ID="lbSave" runat="server" onClientClick="return ValidateAssetCategory()" onClick="lbSave_Click" />
And from your Javascript function ValidateAssetCategory return true if you need server side to execute, otherwise put false.
function ValidateAssetCategory()
{
if(...) return true;
else return false;
}
Cheers.
|
|
|
|
|
It works fine now with your guide. Thanks.
Tunsten
|
|
|
|
|
Hi
I think that you write "ValidateAssetCategory" function out of your aspx page
If It's not out of your page please excuse me
Mohammad Khansari
|
|
|
|
|
yes... from a .js file and it didn't work. but I got it working when I inserted into my .aspx file. Thanks.
Tunsten
|
|
|
|
|
Hi dev team,
I need to display details of a selected item from a gridView control as a popup either on a DIV tag or on another page populated with JavaScript (this means; the keyfield would be passed as a QueryString object to the popup page) code.
Anyone with sample source code please?
Tunsten
|
|
|
|
|
You can do it easliy during GridView RowDataBound Event.
<br />
void SampleGridView_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
if (e.Row.RowType == DataControlRowType.DataRow)<br />
{<br />
}<br />
}
I have just given you the hint. . Now hope you can go ahead. Please let me know if you need more help.
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Yes I need more help on what the JavaScript code could look like, please.
Thanks in advance.
Tunsten
|
|
|
|
|
Just to confirm one thing, You want popup tobe open on row selection or by clicking of any of the control of that row.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
on row (the ID/keyfield of the row) selection
Tunsten
|
|
|
|
|
Hi peoples,
i m trying to send an mail from my application (localhost)
this is my code..( i copied from website)
// Command line argument must the the SMTP host.
SmtpClient client = new SmtpClient("localhost");
// Specify the e-mail sender.
// Create a mailing address that includes a UTF8 character
// in the display name.
MailAddress from = new MailAddress("hbairavan@yahoo.com", "Jane " + (char)0xD8 + " Clayton",
System.Text.Encoding.UTF8);
// Set destinations for the e-mail message.
MailAddress to = new MailAddress("hbairavan@yahoo.com");
// Specify the message content.
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(from, to);
message.Body = "This is a test e-mail message sent by an application. ";
// Include some non-ASCII characters in body and subject.
string someArrows = new string(new char[] { '\u2190', '\u2191', '\u2192', '\u2193' });
message.Body += Environment.NewLine + someArrows;
message.BodyEncoding = System.Text.Encoding.UTF8;
message.Subject = "test message 1" + someArrows;
message.SubjectEncoding = System.Text.Encoding.UTF8;
// Set the method that is called back when the send operation ends.
client.SendCompleted += new
SendCompletedEventHandler(SendCompletedCallback);
// The userState can be any object that allows your callback
// method to identify this send operation.
// For this example, the userToken is a string constant.
string userState = "test message1";
client.EnableSsl = false;
client.UseDefaultCredentials = false;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Credentials =
new System.Net.NetworkCredential(from.ToString(), "f00bar");
client.SendAsync(message, userState);
after this line am getting exception that
failure sending mail..
wat may be the reason.please help
\
thanks in advacnce
|
|
|
|
|
Hema Bairavan wrote: // Command line argument must the the SMTP host.
SmtpClient client = new SmtpClient("localhost");
You have putted "localhost" as your SMTP Server name. I guess this is wrong. Does your SMTP Server configured properly. What is the name of the Server ?
Try This link.
http://support.microsoft.com/kb/323436[^]
Hema Bairavan wrote: after this line am getting exception that
failure sending mail..
Please check your server configuration as I have suggested. Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|