Web Forms :: How To Change Src Of Embed Tag Runtime
Apr 12, 2010
i m using embed tag for displaying video file.i want to change file in src attribute of embed tag runtime when i click on button.how can i access embed tag in my .cs file .
In my website1, I posted some data to my website2 by doing an HttpWebRequest.The data are posted successfully but what I wanna do is change the imageUrl in website2 after website1 fired some data. When I try to debug, I can see that it passes through the code of changing the ImageUrl, but when I view the source of website2, I can't see the imageUrl being change at all... Does anyone have a clue?
one of my client has the requirement of changing the latest news section of website dynamically or runtime so not to publish the site and host it agian and again.this section is in master page how can i achieve this in asp.net c#
Does anyone has an idea on how to change the connection string of the webparts at runtime. i have a multitenant app, and would like to store each accounts users settings in their respective DB's i tried changing the connstring in the webpartsmanager init, and the page load event
Dim myConfiguration As System.Configuration.Configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~")
I'm using the mvc authorize attribute on my controllers. Using forms authentication, I'd like to be able to redirect unauthenticated users to a different loginUrl based on the route or target url. I'm guessing that creating my own authorize atribute isn't the right thing to do because it shouldn't know about the authentication module you are using (Windows/Forms etc). What would be a good way to acheive this?
My issue is that , need to change the column name(following some format) of the gridview (which is binded with XMLTextReader). Without changing directly XML file, Required to change the column name dynamically at runtime .
At runtime I would like to be able to change the ascx to another path, it would still be inheriting from the same usercontrol codebehind, it would just be a different template.
I'm filling a previously created DataGridView on an ASP.NET Web Form dynamically with a DataTable, but I want to change the name of the columns that appear on that DataGridView, and I simply can't figure out what I'm doing wrong. Below is the code:
DataTable dtUsuarios = DBManager.RunSqlGetDataTable( @"select b.UserName, c.Email, c.IsLockedOut, c.LastLoginDate, case when e.RoleName is not null then 1 else 0 end Admin from dbo.aspnet_Applications a join dbo.aspnet_Users b on a.ApplicationId = b.ApplicationId join dbo.aspnet_Membership c on b.ApplicationId = c.ApplicationId and b.UserId = c.UserId left join dbo.aspnet_UsersInRoles d on d.UserId = b.UserId left join dbo.aspnet_Roles e on d.RoleId = e.RoleId where a.ApplicationName = 'Mont Blanc Catalogo'"); dtUsuarios.Columns["UserName"].Caption = "Nome Usuário"; dtUsuarios.Columns["Email"].Caption = "E-mail"; dtUsuarios.Columns["IsLockedOut"].Caption = "Bloqueado"; dtUsuarios.Columns["LastLoginDate"].Caption = "Último Login"; dtUsuarios.Columns["Admin"].Caption = "Administrador"; DataView dvUsuarios = new DataView(dtUsuarios) { Sort = "UserName" }; gdvUsuarios.DataSource = dvUsuarios; gdvUsuarios.DataBind(); //gdvUsuarios.Columns[0].HeaderText = "Nome Usuário"; //gdvUsuarios.Columns[1].HeaderText = "E-mail"; //gdvUsuarios.Columns[2].HeaderText = "Bloqueado"; //gdvUsuarios.Columns[3].HeaderText = "Último Login"; //gdvUsuarios.Columns[4].HeaderText = "Administrador";
Setting the values changing the caption of the DataTable doesn't work, and after the DataBind, the Columns.Count property for the DataGridView return zero columns! After executing the code, everything appears normally at my asp page, but the captions are wrong.
I have tabs in a page. Each tab has a background image of fixed length. So when the text for the tab is bigger("arrangement help"), it displays "arrangement" in one line and "help" underneath. My goal is to display arrangement and help in one line. Tabs have to customizable.I am using css for regular tabs.
#tabs a { float:left; background:url("../images/selection_deselect_bg.jpg") no-repeat right top; margin:0; text-decoration:none; width:105px; text-align:center; height:24px; font-size:12px; color:#00779c; font-weight:bold; text-decoration:none; }.
I have an bigger image and i am able to get the size of the text in tab. But how to use bigger image for the tab? How to use change background on runtime.
Protected Sub gvCriticalMaterials_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvCriticalMaterials.RowCreated If e.Row.RowType = DataControlRowType.DataRow Then If Trim(e.Row.Cells(7).Text) <> "" And Trim(e.Row.Cells(10).Text) <> "" Then If Convert.ToDateTime(e.Row.Cells(7).Text) < Convert.ToDateTime(e.Row.Cells(10).Text) Then e.Row.Cells(7).ForeColor = Drawing.Color.Red End If End If End If End Sub
But it never shows any value for text in the cells.
First time using the ASP.NET CreateUserWizard control and we are aliasing the Username Textbox as the Email Address because the clients wants the username to be an email address. Then hiding that controls EmailAddress. This part is working fine. The problem I'm having is the error message that gets displayed on the UI says "enter a different user name." if you type in a existing email address. We need to change this to "enter a different email address". I added a event handler for the OnCreateUserError. Added the code below, and debugging the events gets hit and sets the Literal.Text of the error message to display. Still gets overwritten on a later event. Does anyone know what I'm missing to get this error message to the UI.
protected void userWizard_CreateUserError(object sender, CreateUserErrorEventArgs e) { // check for dupe username error if (e.CreateUserError == MembershipCreateStatus.DuplicateUserName) { // If so change to dupe email error and set the literal e.CreateUserError = MembershipCreateStatus.DuplicateEmail; Literal errorMessage = (Literal)userWizard.WizardSteps[0].Controls[0].Controls[0].Controls[0].Controls[0].FindControl("ErrorMessage"); errorMessage.Text = "Email address already exists. enter a different email address."; } }
I am working on an ASP.Net web application running on framework 2.0. I have values stored in users cookie. During testing when the cookie value has been changed the asp.net runtime error page gets displayed.I have custom error mode set to On but somehow this error dosent get redirected. Can anyone tell me what I need to do/set for the custom error page to get displayed in this scenario?
Runtime ErrorDescription: An application error occurred on the server. The current customerror settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewableon remote machines, please create a <customErrors> tag within a "web.config"configuration file located in the root directory of the current webapplication. This <customErrors> tag should then have its "mode" attributeset to "Off".
This property was originally set in the aspx file, however I want to change it to select programatically on page load. I set the Pager.PagedControlID property, but I receive the following error message on this line:
Pager.PageSize = Convert.ToInt32(ListLength);
Page properties cannot be set because no IPageableItemContainer has been found. The ID I am using I copied and pasted out of the inline aspx and I checked it is correct.
I am making a web project now. And i meet some problems working with Entity Framework. My program needs to have dynamic model. I try to explain. So i have classes and database is created from them. At the beginning of work program checks in folder Modules for assemblies and looks for classses that needs to be created as tables in database(this classes have to become a part of ef model). And i need at runtime create database.If some new classes was added so add this tables to database, but not recreate it(as it is made by default). If i delete classes the tables are not deleted.