|
YES YES YES DoctorMick....that DID it. I had the list boxes initially loading in the Page_Load event and it was being confused by the postback. I do not use ASP.NET that often and sometimes have trouble migrating from C# applications....THANK YOU very much.
I am having an issue with WEB Posting on another application, which works perfectly in the desktop browser but is also giving a NULL exception error when is is running online (losing SESSION values). I will be posting that a little later today. I hope you have a moment to give it a look....and thank you all for your responses...much appreciated...Pat
|
|
|
|
|
Yes...with the debug active, the error occurs immediately upon selection of the item in the listbox when the "SelectedIndexChanged" event fires, so selecting an item does trigger the event. It just reports a NULL value even though an item is selected. It seems simple enough and I am thoroughly confused about why.
|
|
|
|
|
We are using AjaxPro2 and have following code:
JSTextTransfer.aspx
<script language="javascript" type="text/javascript">
function Getajaxfunction()
{
var flag = TextTransfer.CallAjaxFunction("Test");
alert(flag.value);
}
</script>
JSTextTransfer.aspx.cs
public partial class TextTransfer : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(TextTransfer));
if (!IsPostBack)
{
}
Btn_Ajax.Attributes.Add("onclick", "javascripe:return Getajaxfunction();");
}
[AjaxPro.AjaxMethod]
public string CallAjaxFunction(string atr)
{
return "Test";
}
}
We get the following error:
TextTransfer is undefined.
The page is hosted on a server which has the following directory structure
/htdocs/
/htdocs/bin/AjaxPro2.dll
/htdocs/mysite/JSTextrTransfer.aspx (and .cs)
The tech support says the url which refers AjaxPro has to be changed.
We changed the web.config entries to:
<scriptReplacements>
<file name="prototype" path="http://www.mysite.com/ajaxpro/prototype.ashx" />
<file name="core" path="http://www.mysite.com/ajaxpro/core.ashx" />
<file name="converter" path="http://www.mysite.com/ajaxpro/converter.ashx" />
</scriptReplacements>
Still no luck.
There is a 4th line for ashx in 'view source'.
<script type="text/javascript" src="/ajaxproTextTransfer,App_Web_jstexttransfer.aspx.5d7ed009.aexw4iuf.ashx"></script>
How can this dynamic entry be added in the web.config? Is this what is causing the error?
Or is there any other solution to overcome this?
Thanks in advance.
|
|
|
|
|
What is AJAX Pro ? Do they not have a forum ? I believe most people here use the ASP.NET AJAX extensions.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Hiiiiiiii..........I am creating n number of text dynamically,and saving them in database and heading for all these text boxes is already saved in db and i m updating data of textbox in same database wid respective heading............but when i m going to save it updates last value to all fields. for e.g. if i m wrote ONE in last textbox then that value will be updated in all columns. My code is :
Dim id As Integer = Request.QueryString("ui")
Panel2.Visible = True
Panel4.Visible = True
Dim cmd2 As String = ("Select Specification from DefineSpecification where CategoryID=" + id.ToString())
Dim rdr2 As IDataReader = db.ExecuteReader(CommandType.Text, cmd2)
Dim conn As New SqlConnection
Dim cmd As New SqlCommand("Select Count(*) from DefineSpecification Where CategoryID=" + id.ToString(), conn)
conn.ConnectionString = ConfigurationManager.ConnectionStrings("See2Buy").ConnectionString
conn.Open()
Dim count As Int32 = Convert.ToInt32(cmd.ExecuteScalar())
While rdr2.Read
Dim lbl = New Label()
lbl.Text = rdr2.Item("Specification")
Dim cmd3 As String = "Insert into Specification(ProductName,SpecificationHeading)Values('" + txtProductName.Text + "','" + lbl.Text + "')"
Dim dbcmd1 As DbCommand = db.GetSqlStringCommand(cmd3)
db.ExecuteNonQuery(dbcmd1)
For i As Integer = 0 To count
Dim txtCtrl As TextBox = DirectCast(Panel4.FindControl("txt" & (i + 1)), TextBox)
If txtCtrl IsNot Nothing Then
TextBox1.Text = txtCtrl.Text
Dim cmd4 As String = "Update Specification set SpecificationDescription='" + TextBox1.Text + "' where ProductName='" + txtProductName.Text + "' AND SpecificationHeading='" + lbl.Text + "'"
Dim dbcmd As DbCommand = db.GetSqlStringCommand(cmd4)
db.ExecuteNonQuery(dbcmd)
End If
Next
End While
|
|
|
|
|
Looks to me like you insert the same value from the textbox all the time. Your code is also bad for other reasons. The most obvious one - I can erase your database any time I like, because you do nothing to protect against SQL injection attacks.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
KhandelwalA wrote: I am creating n number of text dynamically,
Where did you crated the textbox? means in which event? If you are not creating dynamic textbox before Page_load() . and best to create in Page_PreInit() . Because all Postback data and ViewStore data restore just before Page_Load().
So if you create dynamic textbox before page_laod it will not able to hold the viewstate or postback data.
|
|
|
|
|
I am facing the following problem.
i have a solution file having more than one asp.net-c# project file.
I have added Web setup file to the solution and then add->group option, then the primary output and the content file of all the project to the setup project.
Then I have built it. And then installed it. This all the process was successfully done.
A virtual directory was created too.
But when I want to browse the site, i can see all the html pages. but no .aspx file. then I have discovered that there is no .aspx.cs file in the location.
I am deploying a project for the first time.
Please help.
Thanks in advance.
Anujit Karmakar
Software Programmer
|
|
|
|
|
Good Day Anujit
There are Different types of Deployment , Some don't have the CS some do have. In the Properties -->MSBuild Options, you will find that there is an option that says "Allow precompiled site to be updatable" or others , if one one them are checked then uncheck them and build your setup again and install it and the CS Files will be in your destination file.
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Anujit wrote: but no .aspx file. then I have discovered that there is no .aspx.cs file in the location.
aspx file should be there. but there should have no aspx.cs file. And the reason is the deployment of web application (publishing). I will suggest you first read the article, then let me know if any doubts
WS Publishing
|
|
|
|
|
hi,
I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically?
regards
Bill
|
|
|
|
|
this should help[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
backup database 'dbname' to disk='C:\...'
Sabari MD
Application Developer
Veloxit Info Solutions
|
|
|
|
|
That is Simple
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- backup a database
ALTER PROCEDURE [dbo].[sp_BackupDatabase]
@databasename varchar(32),
@path varchar(256),
@filename varchar(64)
AS
set nocount on
declare @sql varchar(4000)
select @sql = 'BACKUP DATABASE ' + ltrim(rtrim( @databasename ))
select @sql = @sql + ' TO DISK = ''' + ltrim(rtrim(@path)) + ltrim(rtrim(@filename)) + ''' '
select @sql = @sql + ' WITH INIT'
--print @sql
execute ( @sql )
select 'Database successfully backed up!' [Result]
Welcome
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi Friends,
Im new in this and hope to get some advice.
I have to make a application to give advice to the students wich study direction they can choose.
They have to get a questionlist that they can awnser. The awnsers can be yes or no, or more then that, with 3 or more choices. The user can only select one awnser. So i have to use radiobuttonlists.
Now how can i implement this ? how can i make dynamically radionbuttonlists? what's the easist way to get this work?
Thanks
|
|
|
|
|
Hi
Are you looking to build the radio buttons in Javascript, or through an AJAX update panel ?
|
|
|
|
|
All you need is to load your data in some data wrapper answer by answer and then bind it to radio button list control by assigning it to its datasource property and call databind upon control.
|
|
|
|
|
if you want to make radio button dynamically , make html radio buttons
Sabari MD
Application Developer
Veloxit Info Solutions
|
|
|
|
|
How do I add a custom function to the built-in function list in InfoPath.
I have some custom functions that gather Active Directory information I would like to auto populate into InfoPath form fields that I want to include in the built-in function list drop down so a non-programmer form designer can apply them to fields on their forms.
I know how to do this programmatically so please don't tell me to add event logic to the form because there are many different organizations designing forms that need this functionality. I need to present these functions to people as they design their forms so they can apply them to textbox fields.
For example I would like a textbox field to populate with AD information, say telephone number or location, just like they would apply the userName function to get the name of the user logged into the workstation filling out the form in an application.
|
|
|
|
|
Hi,
I a parent page i have two frame, each having diffrent source pages.
How can i reload a page from another page?
eg: page Frame.aspx having two frames, onec src is home.aspx, second is user.aspx. When a button click event occur in home.aspx, i need to reload the user.aspx without changing position and without reloading Frame.aspx
Thankyou
YPKI
|
|
|
|
|
Didn't you try Master Pages instead of html frames ?
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
plz anyone send updating gridview in simple steps.its source should b taken from more than one table and having no datakey
|
|
|
|
|
Any specific questions ? If you google or bing it you will get a lot examples
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|