|
pavya_Cool wrote: that is also question...
You created the application and you don't know how it came. It's strange
|
|
|
|
|
Actually i am new to ASP.Net.
Pravin
|
|
|
|
|
Looks like you're trying to create a project of the wrong type. I'd be inclined to abandon this version, and create a new ASP.NET project. There is no exe in an ASP.NET project.
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 am beginner of asp.net. Now generate a sample project for training purpose using Visual Basic coding. Some function using more than one form.
Now I write a same function into every form.
But I need the particular function using different form
without writing a same coding.
How to create a function and which place to store it.
Please give me idea in detailed. I need a sample coding.
abglorie
|
|
|
|
|
This can be achieved by using a static class, for example named Utilities like below
Public Class Utilities
Public Shared Function DoSomething(Byval item as string) as integer
'Do something
End function
End Class
You can then call this from anywhere in your project
Dim myValue as integer = Utilities.DoSomething("Hello")
If you are using c# post back and I will give you the code for that, which works in a slightly different way.
|
|
|
|
|
SHatchard wrote: This can be achieved by using a static class, for example named Utilities like below
Why you are so specific on Static class ?
|
|
|
|
|
abglorie wrote: Now I write a same function into every form.
But I need the particular function using different form
without writing a same coding.
Create a base class and inherit this base class in all the pages. Write common function in Base class. By default you will see all the ASPX pages are inherited by Page class. You have to remove this and write your base class and your base class should inherit from Page class.
|
|
|
|
|
AFter successfully achieved form authentication how to redirect the page to the corresponding next page?
|
|
|
|
|
Call the next page. using following coding
Response.Redirect("NextPage.aspx")
|
|
|
|
|
|
Can anyone tell me how to get click event of Flash Object?
I have to redirect to some page on click of the flash object. I have tried Onactivate event of the object, and its working fine in IE but not working in FireFox and Safari browser
|
|
|
|
|
Now I need a help from you quite urgent.
I read a data from DataSet as EmpID.
Display the EmpID in form1.aspx using Label control.
Data Enter in textbox controll like salary.
Now click a submit button.
The form refresh and update the salary respective EmpID.
Next we want the empID move to next employee.
How to apply the above task.
I try to session state but not working. my form was developed following method.
form.aspx
<asp:label id="Mylabel" text="<%Session(" ds")("empid")%="">" runat="server">
<asp:textbox id="MyText" runat="server">
<asp:button id="Submit" text="Submit" runat="server">
form.aspx.vb
dim cmd as new sqlcommand("Select EmpID from MyTable", connection)
dim adp as new sqldataadapter(cmd)
dim ds as new DataSet()
Try
connection.open()
adp.fill(ds,"MyTable")
session("ds") = ds.tables("MyTable")
catch
finally
connection.close()
end try
abglorie
|
|
|
|
|
Hi,
You may want to look more into using a datareader for this type of usuage if your wanting to cycle through a record at a time.
An SqlDataReader sits in the System.Data.SqlClient namespace.
You call a read by something like this (this isn't perfect code as I work in c#!)
SqlConnectionconnection = newSqlConnection("myconnectionstringhere")
Dim command As SqlCommand = newSqlCommand("SELECT * FROM Customers", connection)
connection.Open()
Dim data As SqlDataReader = command.ExecuteReader()
data.read()
The Data.Read method will advance and retrieve the next record. Remember to close the connection once your done with it.
Do a search on google for SqlDateReader and you will get information on it's usage back.
Regards
Paul
|
|
|
|
|
hi friends
in my application i am using Iframe
i have three form 1) checkout.aspx 2) frameurl.aspx 3) abc.aspx
from checkout.aspx i redirect to frameurl.a
on frameurl i have one Iframe Iframe's src is abc.aspx
abc.aspx is outside url
which shows in Iframe control
I enter some key here
When i Enter key and press 'Submit' button
i want to redirect to Checkout.aspx
my problem is it redirects to Checkout.aspx
but shows in same Iframe means IE's url doesn't change
Thanks
|
|
|
|
|
kmanisha wrote: my problem is it redirects to Checkout.aspx
but shows in same Iframe means IE's url doesn't change
Specify target=_self or _blank
|
|
|
|
|
i was trying to display a image on the right side of the node.....
any help is appreciated
|
|
|
|
|
I have two dataset. Each datasets contain one table .
Dataset1.Tables[0];
----------------------------
Id Description
100 Raja
101 Jayaraj
102 Ramesh
103 Mani
104 kavitha
Dataset2.Tables[0]
-----------------------------
Id UpdatedWhen
100 05/06/07
104 01/09/00
How can i filter the above datasets columns by using DataView?
The result should be like this
Id Description
101 Jayaraj
102 Ramesh
103 Mani
The result going to bind in DropDownList , like this
Jayaraj
Ramesh
Mani
Pls give the code ASAP
|
|
|
|
|
Navigate through the Dataset2.Tables[0] records and have the collection of ID in a string.
write something similar to this...
For Each drow In Dataset2.Tables(0).Rows<br />
Str = Str + drow("ID") + ","<br />
Next<br />
str.Remove(lstr.Length - 1, 1)<br />
To filter the records
Dim dv As DataView<br />
dv = Dataset1.Tables[0].DefaultView<br />
dv.RowFilter = "ID NOT IN (" + str + ")"
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
hi friends
i have class name as class1.cs.
how to create the javascript popup window in class.
i got the window in aspx page,but class page shown error.
regards
saravanan
|
|
|
|
|
saravanan05 wrote: javascript popup window
window.open('PagePath','WindowName','WindowAttributes');
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|
|
saravanan05 wrote: i got the window in aspx page,but class page shown error.
In class, Response/Page object won't be available. So you need to pass these objects manually when your class is initializing. You can pass through constructor like
class1 c1 = new class1(this.Page) / class1 c1 = new class1(this.Response)
In your class take these variables and do as usual you do in ASPX page.
class class1
{
private Page CurrentPage = null;
public class1(Page p)
{
CurrentPage = p;
}
}
|
|
|
|
|
Hi all,
i am working on a web application which reads html data saved into the database and displays it to a newly opened word file.
here HTML contain is one html file saved into the database as simple string.
i am able to read these contents and write to word file, but problem is that it is writing as simple characters only, it's not writing it as html like if this is the line in content my content after writing it is coming as my content only, all html contents are apparing and all other html data is also coming as text.
can anybody help me how can i write these html contents so they appear as html on word file...
People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily
Akhilesh Singh
|
|
|
|
|
Hi,
This is my situation, I have a ASP.NET website that has a mysql database behind it.
I can't work out how to store news articles.
Basically my news articles are written in MS word and saved as web pages, then changed to .txt files to give me the html code that will display the text the same as it is diplayed in the original word file.
But I can't store this html string in my mysql database using a gridview insert command to insert it. It doesn't like special characters. The mysql field type is text.
At the moment I am getting around it by just storing the .txt file name in the database, then finding it, and using StreamReader to read the html code. This works fine, but it means every news article has to be stored as a .txt file in the server file. I won't to be able to save this data in the database.
I don't won't to open a new page to display the news article.
Am I going about this the wrong way, is there a better way to store news articles?
Is there a way to insert the special characters into the mysql database using gridview?
|
|
|
|
|
hello all....,
i have a error, but it's can working.. i have post this in forum 4 thread and codeproject 3 thread, but they give answer can not working... so, pls... help...
i have 2 page like default.aspx and cart.aspx.
this is my code:
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... it can work properly.. but this error can active if there is a some error or warning in the page.
if page not have any errors or warning, this error can not active,but sometimes can error..
so i want to this error resolved, i want _default can be defined...
plz... helppp.....
thx......
|
|
|
|
|
hardyyanto wrote: i have a error
can you explain the error and show the code that is specific to the error?
Regards J O H N
"Even eagles need a push." David McNally
|
|
|
|