|
Hi,
One of my clients started developing a new web app in ASP.NET 2.0. After a couple of months into development, they decided it was taking too long, that the same app would take them 3-4 months to complete in ASP, and then they would migrate to ASP.NET 2.0.
I am wondering if there is anything they can do now in the new ASP app that would make migration to ASP.NET easier. For instance, would it be easier if they, and can they, use VS2005 to develop the new ASP app? Can they develop the new app over ASP.NET 2.0 and have the old ASP Server classes such as Server, Request, Reponse, etc., available to them? Or rather what will they not be able to do in the classic ASP way, in VS2005 and .net 2.0, that they could do when it was just ASP? What are the big hurdles that typically come about when code is ported from ASP to ASP.NET, and could they do something now, in the new ASP code base to prevent that?
Any info is appreciated.
Thanks.
-Shefali
|
|
|
|
|
You can do classic ASP style coding in ASP.NET 2.0, not that I'd ever want to. You can just open an aspx page and hack at it just like you did with ASP, but you lose a lot of the ASP.NET features. I'd see what they are having trouble with and guide them in the right direction for the new platform before I helped them take a step backwards like that. Also, Server, Request and Response are all there in ASP.NET it would be difficult to write any real application without using them, so that question makes me think they aren't understanding something about ASP.NET and are making things harder on themselves.
They are just delaying the inevitable by going back to ASP and it is going to take longer for them to do the port then they would have lost learning ASP.NET.
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you.
-Chris Maunder
|
|
|
|
|
we have an issue where we recently reset a service account's password. the password begins with a special character (one of these !@#$%^&*()~). I was wonderingif anyone has ever heard of ANY of these causing issues with authentication when using a specified account for impersonation in a web.config file.
we keep getting this error:
Could not create Windows user token from the credentials specified in the config file
and it is locking out the account.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Have you tried using a pw that does not have a special character at the beginning, and tested it? Most password rules mandate a special character not being in the 1st position. Maybe there's a reason for it.
|
|
|
|
|
You learn something new every day. I was able to test it with another account that does not have a special character at all in the password and it works, but the problem with that is obviously we cant tell if the password or the account is the problem....
You have given me something to think about though.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
How can I resize the dropdown portion of a fixed dropdown list when the user clicks the dropdown arrow with ASP.NET and C#.
|
|
|
|
|
When this question was posted before, I spent some time researching it and couldn't find a way to do it. I might be wrong, but it seems to be controlled by the browser.
|
|
|
|
|
Hello fellow developers!
I'm currently working on a website in which users should be allowed to log in. We have an existing user database (SQL Server 2000), and I would like to use this database along with the ASP.NET login controls. Is this possible?
I've been researching and found out that a possible solution would be to implement my own version of the MembershipProvider abstract class. Before I wander down that dirty dark road, I would like to know, if there is an easier way. I thought perhaps it would be possible to configure the SqlMembershipProvider to fit my needs.
We are unable to change the design of the database since it is part of an existing system.
Best regards
Soeren
|
|
|
|
|
If you're looking to use the existing database for login validation then all you need to do is handle the OnLogin event of the Login Control and authenticate against it. No need to implement a Membership Provider.
only two letters away from being an asset
|
|
|
|
|
Okay. Looks nice.
I assume this is what you want me to do:
<asp:Login runat="server" ID="loginBox" OnLoggingIn="LogMeIn">
</asp:Login>
And in the "LogMeIn" function I should implement my login validation.
Can I be sure, that this will override whatever build in authenticate methods the login contol may have? The reason I'm asking is because the standard setup seems to work against some database in my App_Data folder, without any code at all.
Best reagards
Soeren
|
|
|
|
|
Oh well stupid me just found out what I think you meant!
The solution must be to inherit the Login class, and implement your own version of
protected void OnAuthenticate(AuthenticateEventArgs e)
Inside this you do your user validation stuff and set the "e.Authenticated" property to true - if the user validates of course - otherwise false.
It seems to do the trick for me.
If (I'm totally wrong)
please correct me! :-);
Best regards
Soeren
|
|
|
|
|
Not at all what I meant.
1) Drop the login control on you page
2) Implement OnLoggingIn handler
3) Authenticate user in any way you choose
4) Call FormsAuthentication.RedirectFromLoginPage
Simple as that, no need to create a derived class
only two letters away from being an asset
|
|
|
|
|
hi,
i want to display images as a dropdownlist items
can anyone help me plz
thanx
rony
|
|
|
|
|
I don't think this is possible!
Best Regards
3ala2
|
|
|
|
|
Hi Developers
I have a datagrid contains Tasks in a Queue. Now I need to move tasks up and down with two Up and Down (in each row of Grid).
Note: Grid should Refresh after clicking on up/ down arrow and records need to be updated in database also.
Please let me know if you know further explanation for that.
Thanks in advance
Lets work it Out.........!
|
|
|
|
|
You need to have a sort order column, probably an int, that gets updated when the user clicks on one of the arrows. The column is updated and the gridview is refreshed and all is right with the world.
only two letters away from being an asset
|
|
|
|
|
Hi
When i set the attribute 'requestLengthDiskThreshold' in web.config file under <httpRuntime /> tag im getting the following error
"The attribute 'requestLengthDiskThreshold' has been locked in a higher level configuration."
But its working fine locallly. when i work on web server im getting this error.
Please inform me any idea related to this..because its very urgent for me
Regards
RPL
-- modified at 8:00 Wednesday 13th December, 2006
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
This would suggest that a higher level config file (such as machine.config) is locking the attributes. This is normally done like this:
<configuration>
<location application="App1" allowOverride = "false">
<system.web>
</system.web>
</location>
</configuration>
Unfortunately, you cannot remove this at the level you are at. It is a feature to prevent you from overriding server settings that could compromise the server.
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.
|
|
|
|
|
Hi Pete
Please give me any idea to solve this problem.i need to upload over 10MB size of file on my web server.
Regards
RPL
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
RPL - sorry to say, but if you're on a commercial web server then you probably aren't going to be able to do this via the upload file option because, as I stated earlier, the machine.config file has locked down parts of the settings.
Can you use FTP to transfer the file up instead?
Alternatively, you need to get your web host to relax the rules for your application.
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.
|
|
|
|
|
hai friends,
this is kishore,
i have one requirement importing data from excel to database, it should be done at server side
it is very urgent need
i could get succeed in exporting database to excel ,but iam unable to import excel to database
actually i have got the solution
but it is giving some problems, it is working only for one workbook(excel)
the code is below
'Getting a file path
If Not FILE1.PostedFile.FileName = "" Then
FilePath = FILE1.PostedFile.FileName
End If
'Excel Work Sheet Database Connection
MyConnection = New System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=" & FilePath & "; " & _
"Extended Properties=Excel 8.0;")
'Select the data from Sheet1 of the workbook.
'FilePath comes as c:\export\mydata.xls
Dim f As Array
f = Split(FilePath, "\")
Dim k As Integer = f.Length
Dim str As String = f(k - 1)
Dim filename As String = str.Substring(0, str.LastIndexOf("."))
'' Select the data from Sheet1 of the workbook.
MyCommand = New System.Data.OleDb.OleDbDataAdapter( _
"select * from [" & filename & "$]", MyConnection)
DS = New System.Data.DataSet 'DataSet
MyCommand.Fill(DS) 'Filling The dataset
please help me, when iam going to export the data from database to excel, it is storing it as c1.xls(we give) and sheet1 name is also stored as c1.xls
when i am going to retrieve the data from it, it is giving an error
please help me
regards
kishore
|
|
|
|
|
Hi,
I am trying to bulk update database using dataset.I think so i have to pass update sql statement but i dont have idea. Can anyone hepl me...
i am sending aspa page code as well code behind..
Please send me code not description....
<%@ Page language="c#" Codebehind="DataSetTest.aspx.cs" AutoEventWireup="false" Inherits="RnD.DataSetTest" %>
<title>DataSetTest
<asp:datagrid id="grdEmployee" style="Z-INDEX: 101; LEFT: 10px; POSITION: absolute; TOP: 105px" runat="server" onupdatecommand="grdEmployee_Update" oncancelcommand="grdEmployee_Cancel" oneditcommand="grdEmployee_Edit" onpageindexchanged="Grid_Change" pagesize="10" allowpaging="True" onsortcommand="Sort_Grid" allowsorting="True" backcolor="#ccff66" datakeyfield="ID" autogeneratecolumns="False">
<headerstyle font-bold="True" backcolor="#ccccff">
<alternatingitemstyle backcolor="#ccffff">
<selecteditemstyle backcolor="#ff00ff">
<columns>
<asp:boundcolumn datafield="NAME" headertext="NAME" sortexpression="NAME">
<asp:boundcolumn datafield="DESIGNATION" headertext="DESIGNATION" sortexpression="DESIGNATION">
<asp:boundcolumn datafield="SEX" headertext="SEX" sortexpression="SEX">
<asp:boundcolumn datafield="AGE" headertext="AGE" sortexpression="AGE">
<asp:boundcolumn datafield="SALARY" headertext="SALARY" sortexpression="SALARY">
<asp:editcommandcolumn buttontype="LinkButton" edittext="Edit" headertext="Edit Command" canceltext="Cancel" updatetext="Update">
<asp:button id="btnDatabaseUpdate" style="Z-INDEX: 102; LEFT: 19px; POSITION: absolute; TOP: 15px" runat="server" text="Update on Database">
Code Behind:--
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;
namespace RnD
{
///
/// Summary description for DataSetTest.
///
public class DataSetTest : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid grdEmployee;
protected System.Web.UI.WebControls.Button btnDatabaseUpdate;
DataSet dsObj=new DataSet();
private void Page_Load(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
try
{
string strConnection= System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString");
//Response.Write(strConnection);
SqlConnection con = new SqlConnection();
con.ConnectionString = strConnection;
SqlCommand cmd=new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "usp_GetEMPLOYEEDETAILS";
SqlDataAdapter sda = new SqlDataAdapter(cmd);
sda.Fill(dsObj,"EMPLOYEEDETAILS");
grdEmployee.DataSource= dsObj;
grdEmployee.DataBind();
Cache["EMPCACHE"]=dsObj;
dsObj = null;
cmd.Connection.Close();
}
catch (Exception ex)
{
Response.Write(" " + ex.Message.ToString());
this.RegisterStartupScript("Dialog",@"alert('Error In Connection')");
}
}
}
public void Sort_Grid(Object o,DataGridSortCommandEventArgs e)
{
if (Cache["EMPCACHE"]!=null)
{
DataSet dsSort= (DataSet)Cache["EMPCACHE"];
DataView dv = new DataView(dsSort.Tables[0]);
dv.Sort = e.SortExpression;
grdEmployee.DataSource = dv;
grdEmployee.DataBind();
dsSort = null;
}
}
public void Grid_Change(Object o,DataGridPageChangedEventArgs e)
{
if (Cache["EMPCACHE"]!=null)
{
DataSet dsSort= (DataSet)Cache["EMPCACHE"];
DataView dv = new DataView(dsSort.Tables[0]);
grdEmployee.CurrentPageIndex = e.NewPageIndex;
grdEmployee.DataSource = dv;
grdEmployee.DataBind();
dsSort = null;
}
}
public void grdEmployee_Edit(Object o,DataGridCommandEventArgs e)
{
grdEmployee.EditItemIndex = e.Item.ItemIndex ;
if (Cache["EMPCACHE"]!=null)
{
DataSet dsSort= (DataSet)Cache["EMPCACHE"];
DataView dv = new DataView(dsSort.Tables[0]);
grdEmployee.DataSource = dv;
grdEmployee.DataBind();
dsSort = null;
}
}
public void grdEmployee_Cancel(Object o,DataGridCommandEventArgs e)
{
grdEmployee.EditItemIndex = -1 ;
//grdEmployee.EditItemIndex = e.Item.ItemIndex ;
if (Cache["EMPCACHE"]!=null)
{
DataSet dsSort= (DataSet)Cache["EMPCACHE"];
DataView dv = new DataView(dsSort.Tables[0]);
grdEmployee.DataSource = dv;
grdEmployee.DataBind();
dsSort = null;
}
}
public void grdEmployee_Update(Object o,DataGridCommandEventArgs e)
{
int id = (int)grdEmployee.DataKeys[e.Item.ItemIndex];
//Response.Write(id);
TextBox txtName,txtDesignation,txtSex,txtAge,txtSalary;
txtName =(TextBox)e.Item.Cells[0].Controls[0];
txtDesignation =(TextBox)e.Item.Cells[1].Controls[0];
txtSex =(TextBox)e.Item.Cells[2].Controls[0];
txtAge =(TextBox)e.Item.Cells[3].Controls[0];
txtSalary =(TextBox)e.Item.Cells[4].Controls[0];
if (Cache["EMPCACHE"]!=null)
{
DataSet dsUpdate= (DataSet)Cache["EMPCACHE"];
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["NAME"]=txtName.Text;
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["DESIGNATION"]=txtDesignation.Text;
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["SEX"]=txtSex.Text;
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["AGE"]=Convert.ToInt32(txtAge.Text);
dsUpdate.Tables[0].Rows[e.Item.ItemIndex]["SALARY"]=Convert.ToSingle(txtSalary.Text);
//dsUpdate.AcceptChanges();
Cache["EMPCACHE"]=dsUpdate;
grdEmployee.EditItemIndex = -1 ;
grdEmployee.DataSource = dsUpdate;
grdEmployee.DataBind();
dsUpdate=null;
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.btnDatabaseUpdate.Click += new System.EventHandler(this.btnDatabaseUpdate_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void btnDatabaseUpdate_Click(object sender, System.EventArgs e)
{
try
{
string strConnection= System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString");
//Response.Write(strConnection);
SqlConnection con = new SqlConnection();
con.ConnectionString = strConnection;
SqlDataAdapter sda = new SqlDataAdapter("select ID,NAME,DESIGNATION,SEX,AGE,SALARY from EMPLOYEEDETAILS",con);
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
//con.Open();
sda.Fill(dsObj,"EMPLOYEEDETAILS");
DataSet dsUpdate = (DataSet)Cache["EMPCACHE"];
//dsUpdate.AcceptChanges();
dsObj = dsUpdate.Copy();
//sda.UpdateCommand = scb.GetUpdateCommand();
int success=sda.Update(dsObj,"EMPLOYEEDETAILS");
//con.Close();
dsObj.AcceptChanges();
Response.Write(success);
grdEmployee.DataSource = dsObj;
grdEmployee.DataBind();
}
catch (Exception ex)
{
Response.Write(" " + ex.Message.ToString());
this.RegisterStartupScript("Dialog",@"alert('Error In Connection')");
}
}
}
}
looking forward for prompt response
|
|
|
|
|
hi all..
i have one problem with navigating between two pages. i have to open page2 from page1. and in page 2 i had to save some records and back to page1 immdiatley after saving. and while going back to page i need to show the records that r updated in page 2.. i have already some selected items in page 1. i donot want to reload the page..
history.back is not working for me.. i am using frames will history.back having any problem with frames??
redirecting page is reloading that page where the user selection is missing..
pls.. give me suggestion how can i solve this..
pls.. urgent ..
thanks..
|
|
|
|
|
Hi
For this u have to use self.close() javascript function for close popup page(page2).
Regards
RPL
r_palanivel83 10:01 4 Jan '06
|
|
|
|
|
hi,
I have used template columns (ItemTemplate and EditItemTemplate to display contents of gridview. it displays all the contents but i added extra commandbutton for edit as <asp:commandbutton headertext="edit" showeditbutton="true"> like this. but in runtime when i click edit link it displays error: Gridview Gridview1 not handled any rowediting event.
Please guide me how to add rowediting event and how to update the editions.
Thanks in advance,
Regards,
Prya
|
|
|
|