|
'TryParse' is not a member of 'Integer'.
Ok try with System.Int32
Best regard
Pathan
---------------------------------------------------
|
|
|
|
|
the same error occured, TryParse is not a member of Integer.
I tried using this code:
For Each i in dbgInbox.Items
txtemailid = i.FindControl("txttsf")
Dim out As Integer
If Integer.Parse(txtemailid.Text, out) = True Then
Response.Write("Done")
else
Response.Write("Failed")
End If
Next
when I entered a number on the Textbox, the error "Input string was not in a correct format" appeared.
maybe i just missed a code in here... "If Integer.Parse(txtemailid.Text, out) = True Then"
regards
bryan
--- If the facts don't fit the Theory, change the facts...
|
|
|
|
|
"If Integer.Parse(txtemailid.Text, out) = True Then " is wrong bcoz
Integer.Parse does not return bool.
Use Integer.TryParse if u got "TryParse is not a member of Integer. " this error then try with this System.Int32.TryParse
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Which verson of .Net r u using?
Best Regard
Patha
---------------------------------------------------
|
|
|
|
|
I hate this coding because i'm coding inside the code not the codebehind.
I'm using 1.1 version
-bryan
<div class="ForumSig">--- If the facts don't fit the Theory, change the facts...</div>
|
|
|
|
|
hi... the same error occurs..
--- If the facts don't fit the Theory, change the facts...
|
|
|
|
|
You can not use TryParse method in 1.1
Sorry
Pathan
---------------------------------------------------
|
|
|
|
|
Hi,
I have a Gridview which contain the 2 columns first column is textbox: ID and second column is the Label for Name. Initially I am loading data into the Gridview from database and the Textbox for ID is in editable mode only. With one save button click I am updating all rows into database.
And one Add button which is outside the Gridview. When the user clicks on the Add I am inserting row to the Gridview. The user enter some value into the textbox ID I need to validate the ID entered If the ID is valid I need to populate the Correspoing name into Name label.
1)Which event I need to fire for Gridview to validate the TextBox entry, Textbox focus lost I need to check the entered ID.
2)If the user changes the ID of the row which Gridview got from Database. Here also I need to validate the Id and populate name for the corresponding ID.
Here my question is which I need to fire for Gridview which need to be fired for the ID text box loosing the focus.
Thanks in advance
|
|
|
|
|
AFAIK, there is only javascript event that can be fired after loosing the focus. So, if your validation function is a server-side function, you can't invoke this from client-script unless you are using Ajax.
So, I think that the sample way would be validating the input when the user click "Add" button instead of checking after loosing the focus......
It is just my idea. We can listen what other members say about that..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
hi everyone
i want anyone help me to make simple code which make search in dataBase and return the words which found in the the text of database with yelow color or any color ..how i do something like this (ASP.NET with C#) ?
thanks in advance
|
|
|
|
|
This can be achieved using Regular Expressions. Check the documentation for Regex class. Before showing results on your ASPX page, you should pass the result to a function where regular expressions are used to find the search keyword in the result text. Now replace the match with your color tag. May be something like <font color="HighlightColor"> + Placematchtext here + </font>
|
|
|
|
|
helloo all...,
i want to ask about item command in form view...
if i use item command in repeater, the code is:
Protected Sub Repeater1_ItemCommand(ByVal source As Object, ByVal e System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles Repeater1.ItemCommand
kode = CType(Repeater1.Items(e.Item.ItemIndex).FindControl("Kode"), Label).Text
End Sub
if i use item command in datalist, the code is:
Protected Sub DataList1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.ItemCommand
kode = CType(DataList1.Items(e.Item.ItemIndex).FindControl("kode"), Label).Text
End Sub
it seems the item command of repeater and datalist are same...
but in formview is different.. the item command of repeater and datalist can not write in formview...
how about that code of item command in formview?
plz help... thx...
|
|
|
|
|
hello all....,
i have a error, but it's can working.. but i want to resolve that error... my teacher and my friends can't resolve it...
my page is
default.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<title>Untitled Page
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:GAMESConnectionString %>"
="" selectcommand="SELECT * FROM [items]">
<asp:repeater id="Repeater1" runat="server" datasourceid="SqlDataSource1">
<headertemplate>
<itemtemplate>
<asp:label id="kode" runat="server" text="<%#Eval("Kode") %>">
<asp:label id="name" runat="server" text="<%#Eval("Name") %>">
<asp:label id="cost" runat="server" text="<%#Eval("cost","{0:n}") %>">
<asp:textbox id="total" text="1" runat="server" width="24px">
<asp:button id="addtocart" runat="server" commandname="buy" text="add to cart" postbackurl="~/cart.aspx?from=default">
<footertemplate>
default.aspx.vb
Partial Class _Default
Inherits System.Web.UI.Page
Private kode As String = ""
Private name As String = ""
Private total As Integer = 0
Private cost As Double = 0
Public Function dataList() As ArrayList
Dim itemselecting As ArrayList = New ArrayList
itemselecting.Add(kode)
itemselecting.Add(name)
itemselecting.Add(total)
itemselecting.Add(cost)
dataList = itemselecting
End Function
Protected Sub Repeater1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles Repeater1.ItemCommand
kode = CType(Repeater1.Items(e.Item.ItemIndex).FindControl("kode"), Label).Text
name = CType(Repeater1.Items(e.Item.ItemIndex).FindControl("name"), Label).Text
total = CInt(CType(Repeater1.Items(e.Item.ItemIndex).FindControl("total"), TextBox).Text)
cost = CType(Repeater1.Items(e.Item.ItemIndex).FindControl("cost"), Label).Text
End Sub
End Class
cart.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="cart.aspx.vb" Inherits="cart" %>
<title>Untitled Page
<asp:repeater id="Repeater1" runat="server">
<itemtemplate>
kode | name | total | cost | subtotal | <asp:label id="label1" runat="server" text="<%#DataBinder.eval(Container.DataItem,"Kode") %>"> | <asp:label id="label2" runat="server" text="<%#DataBinder.eval(Container.DataItem,"Name") %>"> | <asp:textbox id="txttotal" runat="server" text="<%#DataBinder.eval(Container.DataItem,"total") %>"
="" width="20px"> | <asp:label id="label3" runat="server" text="<%#DataBinder.eval(Container.DataItem,"cost") %>"> | <asp:label id="label4" runat="server" text="<%#DataBinder.eval(Container.DataItem,"subTotal") %>"> | grand total: | <asp:label id="total" runat="server" text="0"> | | <asp:label id="subtotal" runat="server" text="0"> |
|
<asp:button id="Button1" runat="server" text="update">
cart.aspx.vb
Partial Class cart
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not PreviousPage Is Nothing AndAlso PreviousPage.IsCrossPagePostBack Then
Dim itembuy As Integer
Dim itemselecting As ArrayList = New ArrayList
If (Request.QueryString("from") = "default") Then
itemselecting = CType(Me.PreviousPage, _default).datalist()
End If
itembuy = Session("Itembuy")
If Not checksameitem(itemselecting(0)) Then
Session("Kode_" & itembuy) = itemselecting(0)
Session("Name_" & itembuy) = itemselecting(1)
Session("total_" & itembuy) = itemselecting(2)
Session("cost_" & itembuy) = itemselecting(3)
Session("subtotal_" & itembuy) = itemselecting(2) * itemselecting(3)
itembuy += 1
Session("itembuy") = itembuy
End If
displayData()
End If
If Not IsPostBack Then
Me.displayData()
End If
End Sub
Private Sub displayData()
Dim a As ArrayList = New ArrayList()
Dim itembuy As Integer
Dim i As Integer
Dim totalItem As Integer = 0
Dim totalcost As Double = 0
itembuy = Session("itembuy")
For i = 0 To itembuy - 1
a.Add(New DataKasir(Session("Kode_" & i), Session("Name_" & i), Session("total_" & i), Session("cost_" & i), Session("subtotal_" & i)))
totalItem += Session("total_" & i)
totalcost += Session("subTotal_" & i)
Next
Me.total.Text = totalItem
Me.subtotal.Text = Format(totalcost, "#,##0.00")
Repeater1.DataSource = a
Repeater1.DataBind()
End Sub
Private Function checksameitem(ByVal kode As String) As Boolean
Dim totalItem As Integer = Session("itembuy")
Dim i As Integer
For i = 0 To totalItem
If (Session("Kode_" & i) = kode) Then
checksameitem = True
End If
Next
End Function
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim totItem As Integer = Repeater1.Items.Count
Dim total As Integer
Dim cost As Double
Dim i As Integer
For i = 0 To totItem - 1
total = IIf(CType(Repeater1.Items(i).FindControl("txttotal"), TextBox).Text = "", 0, _
CType(Repeater1.Items(i).FindControl("txttotal"), TextBox).Text)
cost = CDbl(Session("cost_" & i))
Session("total_" & i) = total
Session("subtotal_" & i) = total * cost
Next
displayData()
End Sub
End Class
Public Class DataKasir
Private myKode As String
Private myName As String
Private mytotal As Integer
Private mycost As Double
Private mysubtotal As Double
Public Sub New(ByVal nKode As String, ByVal nName As String, ByVal ntotal As Integer, ByVal ncost As Double, ByVal nsubTotal As Double)
Me.myKode = nKode
Me.myName = nName
Me.mytotal = ntotal
Me.mycost = ncost
Me.mysubtotal = nsubTotal
End Sub
Public ReadOnly Property Kode() As String
Get
Return myKode
End Get
End Property
Public ReadOnly Property Name() As String
Get
Return myName
End Get
End Property
Public ReadOnly Property total() As Integer
Get
Return mytotal
End Get
End Property
Public ReadOnly Property cost() As Double
Get
Return mycost
End Get
End Property
Public ReadOnly Property subTotal() As Double
Get
Return mysubtotal
End Get
End Property
End Class
my error is in the cart.aspx.vb like the command:
If (Request.QueryString("from") = "default") Then
itemselecting = CType(Me.PreviousPage, _default).datalist()
the error is" type _default is not defined" .. i have no idea to solve this...
plz... helppp.....
thx......
|
|
|
|
|
Have you tried a name that doesn't start with _, and making it case correct ? I realise VB is not case sensitive ( because it sucks ), but it's worth fixing that and seeing if the prefix makes a difference.
However, I'd imagine that the problem is most likely that because your pages do not use namespaces, a namespace is being invented for them, and they are not the same. Try putting both pages into the same namespace, or in namespaces you explicitly scope.
And consider finding a better teacher.
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 )
|
|
|
|
|
thx for ur information...
i have delete the _,but it's same too.
u said that can use namespaces. can u give code of namespaces ?
ok,thx...
|
|
|
|
|
Hi All,
I would like to encorporate a fully functional Windows media Player on to my ASP.Net web Page.
Could any one assist please?
Thanks
|
|
|
|
|
kibromg wrote: fully functional Windows media Player
If you wanna know about how to embedded the Windows Media Player in Web page, you can check this link "Embedding Windows Media Player and playing a video[^]" but I'm not sure whether you will get full functionalities or not... (full functionalities means a lot.. )
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I have a datalist with id='dlResult' and inside the datalist, I have the checkbox id='chkRefer' for each item of datalist. I like to use javascript and (For Loop) to go the the datalist Items and check the CheckBox inside if the Value is Checked==true or false. I am not good with javascript. Please Help with code
Thanks in advance.
Don
|
|
|
|
|
Best way is by checking the source of your aspx page.
go to view source and check the control and also check if it is a chid of anyone and see its id then use that add in your javascript and also see in what way they have given the id
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
|
Hi!
ASP.NET Web Pages are HTML files with embedded chunks of VB script or Java script & the have Dynamic content in them.
What is meant by Dynamic Content ?
Please kindly answer the question.
Regards,
Aniket
Aniket Sonawane
|
|
|
|
|
Try this[^] link - it's amazing the amount of info it has!!!!
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
Aniket Sonawane wrote: What is meant by Dynamic Content ?
Content that you are adding to your page at run time is called dynamic content
Please these type of questions should be search in Google first
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hai all,
i develop a project using c# with asp.net... i need source code for 'download a pdf file from aspx pages' (i.e) i wil give one option for downloading a document... So i need code for that...
Anyone know reply me....
Thanks & regards,
vidyasankar N
Short Time Pains Equals Long Time Gains
|
|
|
|
|
try to give the URL of PDF directly ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|