Latest developer linksBookmark and Share
 
HomeThis WeekTop MonthTop AlltimeSearchRegisterFAQ
  
 
Submit Your Link
Please login to submit your Link
 

php user migrating to asp.net

Posted: Dec/14/2010   By: nikhil   Points:15   Category: .NET  - ASP.Net    Views:140   Vote Up (0)   Vote Down (0)    

Hi, I have a website that I need to add some dynamic data from asp.net, I'm completely new to .net and am having some problems (usually a php user).

K so, I have
a simple html tag
<a href="" title = "" >my link</a>

Now all I want to do is to insert some data in to the href and title parameters. in php I would just use <a href="<?php echo myHrefvar?>" title = "<?php echo myTitlevar?>" >my link</a>

I've tried doing
<a href="<% = myHrefvar%>" title = "<% = myTitlevar%>" >my link</a>

and in my default.aspx.cs I have the variables being set
string myHrefvar = "my href";
string myTitlevar = "my title";

but it always gives the message that they're not linked.

Have also tried
<a href="" title = "" ID=Req1>my link</a>

and in the apsx.cs file
Req1.HRef = "sdsdsd";
Req1.Title = "sdsdsd";

but again I get an error saying Req1 doesn't exist in the current context.

So help, I'm missing something rather fundamental here, any help would be much appreciated.

James

View Complete Post


Comments:
Be the first to comment this post.
 
Post Comment
Please login to post your comment
More Related Resources

Loading User Controls Dynamically

  
User Controls are great in ASP.NET. They let us divide the page into small sections. You can easily use User Controls on a ASP.NET page by simply dragging and dropping the control from the solution explorer. Sometimes we need to load the User Control dynamically. In this small article we will learn how to load the User Control dynamically.

send alert message to user if close internet browser before save web form data

  

 Hi, I have window form to let user fill data, I want to alert user if close web browser before saved web form data, could anyone provide any clue?

 

Thanks,

Martin


How get clientID of a control in a ModalPopup of a User Control??

  

Hi,

I have a user control which has a modal popup. This modal popup has a grid and few controls like textboxes and comboboxes. I am trying to clear out all the controls when the close button is clicked. I am using javascript to close the modalpopup. but to clear the controls, $get('<%=txtbox1.clientID%>') method is returning null. can someone please help me?


Here is my code snippet.

function close_Click() {
    var mdlPopup1;
    mdlPopup1 = $find('modalPopup');
    mdlPopup1.add_hidden(clearInputFields);
    mdlPopup1.hide();
    
}

    function clearInputFields() {
        var name = $get('<%=txtName.clientID%>');

        name.value="";
       }


User control does not let me assign values into Text boxes

  

Hello,

Got a problem that I do not know what is going on (using c# and .NET 2008):

I have a main web page and added a user control inside it. The user control has some textboxes. The problem I have is when I populate the textboxes with the data that is in the DB, they do not show the values. The strange thing is If I change the property of textboxes ReadOnly to TRUE, they show the values. The problem is that I need them to be ReadOnly=FALSE.

Could anyone do help me please?

Thanks,

Marco


Failed to generate a user instance of SQL Server

  

 I am creating asp.net forms authentication. When I run web site and there I try to create new user I get this error:

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:

  1. If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
  2. If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
  3. Sql Server Express must be installed on the machine.
  4. The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.


Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[SqlException (0x80131904): Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4861315
   System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +29
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +4863644
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
   System.Data.SqlClient.SqlConnection.Open() +122
   System.Web.Manage 

User name/Password unauthorized

  

 I'm trying to publish a site and I am fairly confident I have the publishing settings correct in WebMatrix Beta3.

Using the field instructions for WebMatrix provided by cytanium, I'm still not able to publish. The error I get when trying to validate the connection is:

 

Warning: User name/Password unauthorized. Again, I'm using the username and password provided.

 

Many thanks in advance for shedding some light on this.


how to work with the user who loggedin

  

hello every one,

i'm working in my first integral website ,and i'm using the ASP.NET Login Controls but now i need to know how i can work with the user who loggedin ,i wanna visable his Data only not the all users data ,like for example the site is contain medical data for every user  and when one user is logged in it will implement query to visual his Examination only.

Hope i present my Question well

 


Why separate account data and user info?

  

Hi,

If I'm correct the membership functionality separates account and user (profile) data in two tables. Why not one table? What's the design priciple behind this?

Thanks!


Authenticate user with password

  

Hi,

I´m building a home page where logged in users shall buy products. To be able to get to the buy page the user already has to be logged in. But when he shall execute the buy he has to reenter his password again to check the user a second time. How do I check if his entered password matches his user password? I´m using the ASP Membership library and I have passwordFormat="Hashed".

 


Add Membership User Check if Exists

  

I would like to create a sync process between an ADSI table and aspnet Membership using Membership.CreateUser. However, I need to see if a user exists before importing. I can import as long as a user does not exist however I am having trouble checking if users exist and only importing if they do not. Here is my code so far.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim connectionString As String = DirectCast(ConfigurationManager.ConnectionStrings("Human_ResourcesConnectionString").ConnectionString, String)
        Dim conn As New SqlConnection(connectionString)
        Dim comm As New SqlCommand("SELECT First_Name, Last_Name, UserID, Password, Email_Address FROM vw_AD_ADSI_Users_All", conn)
        comm.Connection.Open()

        Dim myDataAdapter As New SqlDataAdapter(comm)
        Dim myDataSet As New DataSet
        Dim dtData As New DataTable
        Dim dtRow As DataRow
        myDataAdapter.Fill(myDataSet)
        conn.Close()

        For Each dtRow In myDataSet.Tables(0).Rows

            Dim UserName = dtRow.Item("UserID")
            Dim FirstName = dtRow.Item("First_Name")
            Dim LastName = dtRow.Item("Last_Name")
            Dim Password = dtRow.Item("Password")
            Dim Email = dtRow.Item("Email_Address")
            Dim Rolename = "SCSClient"
            If Membership.FindUsersByName(UserName) Is Nothing Then
                Membership.CreateUser(UserName, Password, Email)
                Roles.AddUserToRole(UserName, Rolename)
            End If



        Next

    End Sub


Thank you in advance.

 


 
Categories:
.NET
Java
PHP
C/C++/VC++
HTML/XML
SAP
MainFrames
Data Warehousing
Testing
MySQL
SQL Server
Oracle
Javascript/VB Script
Others
Login
 
 
 
 
 Forgot password
 Contact Us   Terms Of use   Share your knowledge