|
heyyyyy
just apply the condition leap year is in four year
so if a >= 4 then leap year
else not a leap year
byeee
lucky
|
|
|
|
|
I have two listboxes ,one of the listbox data is populate in database. And I have two buttons Add and Remove.
Once I click the add the button , the selected items is populated in another list box by using Javascript.
Similarly Remove also.
Give the javascript code or suitable link for the above scenrio
|
|
|
|
|
Use the Following code:
function f_optionMove(s_from, s_to)
{
var e_from = document.getElementById(s_from), e_to = document.getElementById(s_to);//test_form.elements[s_from],e_to = document.forms['test_form'].elements[s_to];
if (!e_from.name)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
if (!e_to.name)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
var n_moved = 0;
for (var i = 0; i < e_from.options.length; i++)
{
if (e_from.options[i].selected)
{
var name = e_from.options[i].text;
var ID = e_from.options[i].value;
e_from.options[i] = null;
e_to.options[e_to.options.length] = new Option (name,ID);
n_moved++;
}
}
if (n_moved)
e_from.options.length = e_from.options.length;
else
alert("You haven't selected any options");
}
function f_optionMoveAll(s_from, s_to)
{
var e_from = document.getElementById(s_from), e_to = document.getElementById(s_to);
if (!e_from.name)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
if (!e_to.name)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
var cntDesc = e_from.options.length;
var cntSource = e_to.options.length;
for (var i = 0; i < cntDesc; i++)
{
var name = e_from.options[i].text;
var ID = e_from.options[i].value;
e_to.options[cntSource] = new Option (name,ID);
cntSource++;
}
e_from.options.length = 0;
}
<
table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<asp:listbox id="lstsource" runat="server" selectionmode="Multiple">
|
|
|
| <
asp:ListBox ID ="lstdestination" runat="server" SelectionMode ="Multiple">
|
|
|
|
|
|
how can i store the values in the 'lstdestination' listbox. Suppose i select the three values from the lstsource. How can i reterive the three values in server side ie., Code behind.
|
|
|
|
|
What is the exact functionality u want, please explain that so that I can give u the proper suggestion.
|
|
|
|
|
hi
found this in codeproject
http://www.codeproject.com/useritems/Listbox_or_combo_box.asp
winnie
|
|
|
|
|
Hi All,
I need to show textbox control in gridview row on mouse over (any other event as I am not sure which event should I capture) and on mouse out it should be a normal row.
Next on Mouse over if I change the value of the textbox then its should change the value of all the dependent textbox, like we have in excel ie; if I have the 10 in A1 cell and 15 in B1 cell and C1 is the sum of A1 and B1 then if I change the value of any of the cells (A1 or B1) then it automatically reflects in C1.
Finally I need to write this in XML file as I dont want to update my Database with this new values.
Please help me...
Thanks in advance...
|
|
|
|
|
When I do UsersDataTable it gives me following error
The type or namespace name 'UsersDataTable' could not be found (are you
missing a using directive or an assembly reference?)
Label2.Text = "Total Record count in the gridview above= " +
((UsersDataTable)e.ReturnValue).Count.ToString();
seema
|
|
|
|
|
I've never heard of that type, where do you expect it to come from ? Or do you just mean DataTable ? You can use the debugger to find out what type e is.
Have you considered using real variable names, or are you entering a code obsfucation contest ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
seemamltn wrote: When I do UsersDataTable it gives me following error
What is UsersDataTable ? Is it a datatable instance ? Check you are using namespace System.Data
|
|
|
|
|
Don't you need UsersDataTable.Rows.Count (if UsersDataTable is the ID of your GridView) ?
|
|
|
|
|
Hi, I am adding fields to my grid view on the fly
but when i try to define the DataNavigateUrlFields = "pid" i have this error
Value of type 'String' cannot be converted to '1-dimensional array of String'.
here is the code, how can i fix that
<br />
SqlDataSource1.SelectCommand = "SELECT * FROM [products]"<br />
Dim lnk As HyperLinkField<br />
lnk = New HyperLinkField<br />
lnk.DataTextField = "pname"<br />
lnk.NavigateUrl = "home.aspx"<br />
lnk.DataNavigateUrlFields = "pid"<br />
lnk.DataNavigateUrlFormatString = "~/home.aspx?pid={0}"<br />
Dim bFld As BoundField = Nothing<br />
bFld = New BoundField()<br />
bFld.DataField = "pid"<br />
GridView1.Columns.Add(bFld)<br />
GridView1.Columns.Add(lnk)<br />
any help
|
|
|
|
|
How do I debug an ASP.NET app in Vista ? On XP I would attach to the aspnet process, in Vista I am attaching to w3wp.exe, and my middle tier code seems to break OK, but my web pages never do.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Fixed it with a reboot. Stupid Vista...
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Michael Sync wrote: I have rebooted my laptop so many times but it still doesn't work..
Better Uninstall the .net Framework and reinstall it and try again.
SSK.
|
|
|
|
|
I have a print button on my aspx page which prints only a particular <div> section of the page. The javascript for this print is coded in vb.net.
When I click on print and refresh the page, the print button click method is getting called once again. I do not want the button click to respond to the event on every refresh.
How can I do this?
Thank you
|
|
|
|
|
Not sure if it explains your situaton, but the answer to the broad question is, if you handle OnClientClick on your button with javascript that returns false, your server click will not occur.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I didnot get you. Can you elaborate please?
thank u
|
|
|
|
|
You can add this code to any button
OnClickClick="return false();"
and the click event will never fire. Replacing this with a call to a method that works out if it should postback, and returns true or false, will allow you to control your ASP.NET button from javascript.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
On refresh, the page is re submitting the onclick event for print. It opens a dialog:
"The page cannot be refreshed without resending the information.Click retry to send information again. or cancel to return to the page u were trying to view".
On click of both retry or cancel ,the page still runs the code in print click. Can you help me? I tried using return false in onclientclick event.
|
|
|
|
|
Ah... OK. Now I see the issue. A refresh will indeed reprocess the postback. Why do you need to do a postback to do printing ? I thought that was done in javascript ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
My guess is that he's using an ASP:Button control for the print button and using the OnClientClick property for the javascript. I think a postback will happen in this instance and that might be what's causing the problem. I'm not sure how that script will affect the postback if you return false; as Christian mentioned.
Maybe if you use
button.Attributes.Add("OnClick","Javascript:PrintMethod();return false;"); instead of the OnClientClick property it will behave differently. I don't have time to test this out right now, but maybe that would work?
|
|
|
|
|
If he adds a ClientClick only, then the button should not post back, but if he returns false, it definately would not post back.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hey guy wht r u doing man if u want to avoid postback
just type at form ispostbackpage=false simply
byeeeee
hope u understand
lucky
|
|
|
|