|
I have seen lots of postings regarding adding rows to boud gridviews.
I need to add Rows to a NOT bound gridview.
The issue is I need to read the data frmo a sql query, and manipulate the grid based on the data, so a bindging will not work.
I need to know how to do an ADDROW to the gridview.
Thank you.
|
|
|
|
|
The easiest way you will find is to use databinding. You can get the data from your query, manipulate it and either create a new datasource to bind the grid to use the exist resultset.
only two letters away from being an asset
|
|
|
|
|
Hi...
I swap items location in listbox on the client side(javascript)
The way that swap items :
I remove it from the old location and insert it in the new location.
the porblem is:
I have many items so.. the listbox use a scrollbar.
when I swap an item that found in the down of the list(you can see the item only if you move the scrollbar down)
the list refreshed and it scroll up the list.
I don't want it to scroll up beacuse I lose the view on the chosen item
after I swap it in the first time...
How i make it not to scroll up?
does anyone knows how to handle the problem?
thanks....
|
|
|
|
|
As you said that you are using JavaScript, try,
document.getElementById("LISTNAME").selectedIndex=document.getElementById("LISTNAME").options.length-1
Regards,
Venkatesh Mookkan.
Software Engineer, India
|
|
|
|
|
Hello
having a problem with this web service. VS [2005]
The message we get when we try and add the web reference is "unable download following files http://10.0.1.7/codered/service.asmx?wsdl". Which is using the internal ip address of the web server. We have check the IIS where the web service has been published to. But could not see why it is using the internal ip and not the external ip address. The actual url is [url]http://83.100.199.125/codered/service.asmx[/url]
Here is the service description sample, maybe someone can check this, as this has the internal ip address at the bottom.
<br />
wsdl:definitions targetNamespace="http://tempuri.org/"<br />
<br />
wsdl:types><br />
<br />
s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"<br />
<br />
<br />
wsdl:binding<br />
<br />
wsdl:service name="Service"<br />
<br />
wsdl:port name="ServiceSoap" binding="tns:ServiceSoap"<br />
soap:address location="http://10.0.1.7/codered/service.asmx"/<br />
wsdl:port<br />
<br />
wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12"<br />
soap12:address location="http://10.0.1.7/codered/service.asmx"<br />
wsdl:port<br />
wsdl:service<br />
wsdl:definitions<br />
I am really hopping someone can help me with this problem.
Many thanks if you can,
Steve
Soap12" binding="tns:ServiceSoap12">
<soap12:address location="http://10.0.1.7/codered/service.asmx">
I am really hopping someone can help me with this problem.
Many thanks if you can,
Steve
-- modified at 12:52 Tuesday 2nd January, 2007
|
|
|
|
|
asp.net
how do i align a numeric value in Gridview cell/label control & textbox control?
t.aransiola
|
|
|
|
|
Align? How do you want to align?
Regards,
Venkatesh Mookkan.
Software Engineer, India
|
|
|
|
|
align currency values to the right in the grid cell
t.aransiola
|
|
|
|
|
You have to use the ItemStyle property to align the Grid Cells.
If you want to align the text in a control, then you have to add,
CONTROLNAME.Style.Add("text-align","right")
|
|
|
|
|
thanks for ur patience with me. pls how do i apply this to a grid column. let say column 4?
t.aransiola
|
|
|
|
|
Hi guys,
any help with a script to compare 2 dates in a web form!!
I tried compare validator in VS2003, but it is not functioning well when using 2 dates in 2 different years..
Thanks in advance...
SH
|
|
|
|
|
You can modify the following code to suit your need.
//Ldt_due can be in mm/dd/yyyy or mm/dd/yyyy hh:mm:ss format
var l_dt = new Date();<br />
var today = Date.UTC( l_dt.getFullYear(), l_dt.getMonth()+1, l_dt.getDate(),0,0,0);<br />
<br />
<br />
var Ldt_Year,Ldt_Month,Ldt_Day<br />
Ldt_Year = String(Ldt_due).substring(0,4)<br />
<br />
if ( String(Ldt_due).charAt(6) == "/" ){<br />
Ldt_Month = String(Ldt_due).substring(5,6);<br />
if ( String(Ldt_due).charAt(8) == " " ){<br />
Ldt_Day = String(Ldt_due).substring(7,8);<br />
}<br />
else{<br />
Ldt_Day = String(Ldt_due).substring(7,9);<br />
}<br />
}
else{<br />
Ldt_Month = String(Ldt_due).substring(5,7);<br />
if ( String(Ldt_due).charAt(9) == " " ){<br />
Ldt_Day = String(Ldt_due).substring(8,9);<br />
}<br />
else{<br />
Ldt_Day = String(Ldt_due).substring(8,10);<br />
}<br />
}
<br />
starttime = Date.UTC( Ldt_Year, Ldt_Month , Ldt_Day,0,0,0);<br />
<br />
if ( starttime <= today ){<br />
alert("Date Due cannot be less than or equal to today's date.");<br />
return 1;<br />
}
Regards,
Satips.
|
|
|
|
|
We used to have a similar problem with the compare validator and two dates.
We were entering dates in British dd/mm/yyyy format but the validators work by default with American mm/dd/yyyy dates. The answer is to include a globalization element in your web.config:
<system.web>
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-GB" uiCulture="en-GB"/>
</system.web>
Cheers,
Dave.
|
|
|
|
|
U r right iam using this script with 'mm/dd/yyyy' format when iam filling the two dates:
onclick="javascript:popUpCalendar(this, TxtFrom, 'mm/dd/yyyy',-10,-200)"
i added the element u gave me but didnt change still giving alert i f i choosed a fromdate in 2006 and todate in 2007.
Any ideas i would be thankful..
|
|
|
|
|
I have never used a popup calendar because I think it is quicker for a user who may have just entered a name and address, perhaps, to continue to use their keyboard to enter a date (or two).
Anyway, that should not be relevant to the immediate problem. Try the following...
Create a page with the following content:
<%@ Page Language="VB" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Test</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Date Range:
<asp:Textbox id="txtDate1" runat="server" columns="15" Text="01/04/2006" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="txtDate1" ErrorMessage="Date must be entered" Display="Dynamic" />
to
<asp:Textbox id="txtDate2" runat="server" columns="15" Text="03/01/2009" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="txtDate2" ErrorMessage="Date must be entered" Display="Dynamic" />
<asp:CompareValidator ID="CompareValidator1" runat="server"
ErrorMessage="Date must be in the format dd/mm/yyyy and it must be after the first date"
ControlToValidate="txtDate2" Type="Date" Display="Dynamic" Operator="GreaterThanEqual"
ControlToCompare="txtDate1" />
</div>
</form>
</body>
</html>
... then test it, change the second date to 03/01/2006 and press the tab key. A suitable error message should appear. Change the second date to 03/01/2007, press the tab key and the error message should disappear.
Hope that helps. If not try looking in C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322\WebUIValidation.js (assuming you are running IIS and your website root folder is C:\Inetpub\wwwroot). I'm not sure if this is the up-to-date JavaScript validation code, especially if you are using ASP.NET 2.0 (or 3.0!) but the version number of 125 suggests it is OK.
I really hope my example helps because the JavaScript code takes a fair bit of time to get to understand.
Cheers,
Dave.
-- modified at 15:29 Tuesday 2nd January, 2007
|
|
|
|
|
Hello all!
Happy new year!
I have a problem with a bizarre ImageButton. It keeps "causing validation". It is part of a table and I use the following code to create it (C#):
ImageButton cmdDelete = new ImageButton();
cmdDelete.CommandName = "Delete";
cmdDelete.CommandArgument = p.DbId.ToString();
cmdDelete.Command += DeleteRecipient;
cmdDelete.ImageUrl = "~/Images/trash.gif";
cmdDelete.CausesValidation = false;
cmdDelete.OnClientClick = "javascript:Page_ValidationActive=false;";
1. Causes validation is false.
2. OnClientClick is set to "Page_ValidationActive=false" - which I've heard should be equal to 1., just for the client.
Now it behaves like this:
The first time it is clicked, it does not cause validation, and the user is deleted and removed from the list. If I click to delete another user, suddenly the button causes validation. If I click it again, it does not! And so on, and so on.
I've tried stepping through the code, and every second time the button is clicked, it causes validation.
Validation occurs server side, since I've tried turning off JavaScript, and the exact same pattern occurs.
I'm kind of confused! LOL!
Best regards
Soeren
|
|
|
|
|
I’ve added namespace System.Web.Security in the forms of my application. I use it for Forms Authentication functionality. Because of it, while redirection to another page the information stored in the session is deleted. I’ve also used method of FormsAuthentication class to redirect to another page. Still it is not storing data in the session. Please tell me the solution on this.
#Abhi#
|
|
|
|
|
Where is your session state being held? If you are using In-proc on a multi-processor machine or against multiple servers then you will find this problem. Change the session state to use the ASP State Server to sort this out. This is an example:
<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I have written a code to download a file which will come from the database. My problem is that the download is working perfectly when the application in running on WinXP. But in Win2000 Professional when i SAVE the downloaded document, then it throws an error in HTML(javascript) Access is denied. And the application does not respond to any other server events after that. So u have to close the browser & then start the application again.
|
|
|
|
|
sanjeev Kumar Gupta wrote: Access is denied
This means that your process does not have the privileges to perform the action. Either change the privileges (which may open you up to security holes) or structure your application in a different way.
|
|
|
|
|
an error occurred during the parsing of a resource required to service this request. please review the following specfic parse error details and modify your source file appropriately
Ambiguous match found
my source is
<%@ Page language="c#" Codebehind="Book.aspx.cs" AutoEventWireup="false" Inherits="Indocan.Book" %>
how to clear this
|
|
|
|
|
Rmesh wrote: please review the following specfic parse error details and modify your source file appropriately
All my source files work fine. Why does that statement sound like an imperative in a homework assignment?
|
|
|
|
|
i got the error on that point only after copying and putting in the new system it will generate the error like above plz help me
|
|
|
|
|
Rmesh wrote: i got the error on that point only after copying and putting in the new system
So, you copied and pasted some stuff, but you don't know how it works. Is that what you are saying?
I really don't think there is enough information to help you. The error message is that something is ambiguous - but until we can see what the possibilities are then help is going to be difficult to come by.
|
|
|
|
|
i ahve developed this project one system in that system it was working well and i copied that folder and pasted in another system and i have virtual directory and everything when i click this book.aspx i will get the above error whilch was marked by yellow at the first line in html view
<%@ Page language="c#" Codebehind="Book.aspx.cs" AutoEventWireup="false" Inherits="Indocan.Book" %>
in the coding side also i have changed every thing
but i am getting the error
Ambiguous match found
and the first line that was page directive was shown and marked by yellow color plz
|
|
|
|