|
i want write a number and with click a button convert it for text
for example:
123 convert to: onehundered twenty two
can any body help me???????????
|
|
|
|
|
I’d suggest to divide your current number first.
With the number “123”:
Divide a copy of your number by 100, that would give you 1, which you can hardcode to be onehundred
Subtract that number from your original number, which will leave you with 23””. Then divide another copy by 10, which would give you 2. (make sure to store as integers, without decimals).. This can be hard coded as “twenty”.. Subtract that data, and the remainder are the single units.. which, again hardcoded would give you 3 ..
Probably there’s a much easier way that would increase cpu and decrease headache speed..
Michael
www.code.ae
|
|
|
|
|
You can do it on the client side with the help of javascript.
Go through this link this will help you.
http://4umi.com/web/javascript/numbertoword.htm
Hope this will solve your problem.
Best Regards,
Apurva Kaushal
|
|
|
|
|
thanks that is very good example very thanks
|
|
|
|
|
How can i make Dynamic data grid or repeate
I fetch records from database depending on them i have to make and display their corresponding records in datagrid
for ex if i got three value from database three data grids shod be come and their record
if i got five value from database five data grids shod be come and their record
|
|
|
|
|
better use repeter inside repeter
put a repeter
<asp:repeter id="outer" ...="">
<itemtemplate>
<asp:repeter id="innerRep">
..
The outer repeted should be repeting the number of records u have
in the itemdatabound event of the outer repeter write
(e.item.findControl("innerRep") as Repeter).datasource=ds.tables[i]
|
|
|
|
|
Pls give some example of this inever faced this kind of task
|
|
|
|
|
actually my requirement is
I will have multiple datagrids on a page. Each data grid will be the same in structure, but seperate from the others due to user requirements of collabsibility, totalling, etc. Now the database will determine how many datagrids I will need to display.
|
|
|
|
|
hi,
i h a class a.aspx.cs which is derive from another class b.cs and a.spx also h a materpage M.aspx which mean it also inherite M.aspx.cs
now the problem is that when i call this page it is being loaded towice without being postback .i second time page load the Post back is still false
due to which gridview column get twice as i m declaring them dynamically but i h solved this problem using Clear() Method .
what might be the reason can some one help me in this regard .
is using Master page and also deriving from basic page causing the problem
Thnx in advance
|
|
|
|
|
Hi there,
I doubt that what you said here is not the code that causes the error, one of the reasons is that the Master page normally does not end with the .aspx extension. Could you post your real code?
|
|
|
|
|
Hi
I want to bind a tree view to a collection object.
I bind the tree view's datasource in the code behind. how do i bind the data items.
I try doing it but i get this error :
System.InvalidOperationException: HierarchicalDataBoundControl only accepts data sources that implement IHierarchicalDataSource or IHierarchicalEnumerable.
I dont have any problem when i bind the collection to a datagrid.
Any help appreciated.
thanks
Jo
|
|
|
|
|
The DataGrid control inherits from the base class BaseDataList which simply requires that the datasource is an object implementing the IEnumerable or IListSource . Meanwhile, the TreeView control (and the Menu control) inherits from the HierarchicalDataBoundControl which only accepts the datasource implementing the IHierarchicalDataSource [^] or IHierarchicalEnumerable [^] interface like you're seeing. For example, in the .net framework the abstract class HierarchicalDataSourceControl implements IHierarchicalDataSource and has two child derived classes SiteMapDataSource and XmlDataSource , and the SiteMapNodeCollection is an example of implementing the IHierarchicalEnumerable inferface. In your case, your custom class needs to satisfy this requirement if you want to bind it to the TreeView control, otherwise you need to manually create the child node collection of the TreeView control.
|
|
|
|
|
Hi All
I am new to developing ASP code behind (VB) via Microsoft Visual Studio .NET 2003, is anyone kind enough to point me in the right direction to connect to MSDE 2000?
I have managed to make connections to a MSDE2000 SQL dbase as console and VB but am struggling to get connected as a webform.
I have searched the web for examples but this is obviously so simple that there are no examples or comments explaining how to do this!
Here is my test code...
Dim sqlconn As New SqlClient.SqlConnection
sqlconn.ConnectionString = "Integrated Security=True;" & _
"Data Source=LocalHost;Initial Catalog=Test;"
sqlconn.Open()
Dim sqlComm As New SqlClient.SqlCommand("SELECT * FROM " & _
"tblDocuments", sqlconn)
Dim sqlReader As SqlClient.SqlDataReader
sqlReader = sqlComm.ExecuteReader
DataGrid1.DataSource() = sqlReader
DataGrid1.DataBind()
When I run the app I get...
SQL Server does not exist or access denied.
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or
access denied.
Source Error:
Line 119: sqlconn.ConnectionString = "Integrated Security=True;" & _
Line 120: "Data Source=LocalHost;Initial Catalog=Test;"
Line 121: sqlconn.Open()
Line 122:
Line 123: Dim sqlComm As New SqlClient.SqlCommand("SELECT * FROM " & _
The database is OK because I can connect to it in 'Server Explorer' within VS Studio and view all the data.
Can someone outline each step required? as I am obviously mising something really silly.
Thanks
|
|
|
|
|
Taterface wrote: Line 119: sqlconn.ConnectionString = "Integrated Security=True;" & _
The connection string must have the sql instance name .
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Hello,
Using a LinkButton how can I ReLoad or Navigate to a different page in an IFRAME.
Thank you for the help.
RB
|
|
|
|
|
What you might need to do is to write a simple client side script block to get reference to the iframe[^], then set the src property to another page. You can attach this block to the LinkButton using the OnClientClick if you are using the ASP.NET 2.0 or the Attributes collection if you are using the version 1.x.
|
|
|
|
|
Thanks for the tip. You got my wheels spinning and I figured it out.
Thanks again.
RB;P
|
|
|
|
|
Ok so I have a button.
Inside the button event I have a particular condition which I need to fire an alert box.
But the problem is I need to fire an alert, but page load has already finished. ( RegisterClientScript wont work)
Anyone have an idea. I do not know in page load wether I should create the alert or not.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: But the problem is I need to fire an alert, but page load has already finished. ( RegisterClientScript wont work)
Why do you think that it doesn't work?
---
b { font-weight: normal; }
|
|
|
|
|
I already tried it.
But its because the button event firest after page load and the Register script are created at the end of PageLoad.
I could however have a hidden field and have a javascript function that evaluates that hidden field and pops the alert box in the onLoad event of the body. But thats kinda ugly.
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: But its because the button event firest after page load and the Register script are created at the end of PageLoad.
What script is created at the end of PageLoad? How does that affect the popup script?
---
b { font-weight: normal; }
|
|
|
|
|
I think were on different wavelengths here.
I need to create a javascript in the button event.
The ClientManager.RegisterClientScript is added at the end of PageLoad.
So, unless theres another Register event that the button can fire to create my script, I have to use a hack with the hidden values.
Although I'm learning about client script callbacks and maybe that will solve it.
Thanks for trying to help,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: I think were on different wavelengths here.
True. You have made an assumption on how RegisterClientScript works that makes you think that you can't use it.
Ista wrote: So, unless theres another Register event that the button can fire to create my script, I have to use a hack with the hidden values.
RegisterClientScript is not an event, it's a method. There is no reason you can't use it more than once in a page.
Actually, if you look at the reference you see that the first two parameters serves no other purpose than handling the situation where you call it repetedly from different parts of the code, that even may be unaware of each other.
---
b { font-weight: normal; }
|
|
|
|
|
Are popup windows a bad design these days with all the popup blockers etc?
I have a really good fit for a popup window in an asp.net business application I'm designing but I'm concerned that the popup window will be in the long run trouble for our less technically savvy potential users.
Is there a do's and don'ts of popup windows anywhere for the modern age?
|
|
|
|
|
I don't remember the code, but IE fires a "pop-up closed" event when it's blocked which you can use to reload the pop-up if it's THAT important to show the pop-up.
As for me, I'd rather steer away from pop-ups. A large part of the public still believe you can get viruses from a pop-up and therefore you'll scare potentioal customers.
If it's indispensable though, do a search on google regarding what I said above Just don't put 'very important info' in the popup as this can be blocked and will result in a diminished experience for the customer. If all else fails, you can always provide a 'Click here to open popup and be my guest' link on the main page.
My two cents anyway...
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
|
|
|
|