I was using a great tutorial by Scott on the ASP.NET website but the code used for the feedback form was in VB and I am used to C#. The project I am working on is in C# so I tried to convert the VB code to C# code. Unfortunately, I am new to ASP.NET and new to programming email code. Below I have what I have and in bold is what has the red lines underneath it. Is anyone familiar with email in C# for a feedback form that can point me in the right direction.
Sub selYear() Dim intYear As Integer 'Year list can be changed by changing the lower and upper 'limits of the For statement For intYear = DateTime.Now.Year - 20 To DateTime.Now.Year + 20 drpCalYear.Items.Add(intYear) Next 'Make the current year selected item in the list drpCalYear.Items.FindByValue(DateTime.Now.Year).Selected = True End Sub
pic #2 is the involved tables and data that we already tried, it works, but only through sql, how can we make the formula where datagrid will show the results.
The CMS I use struggles with UpdatePanels in some of my custom controls and master pages during edits. I'd like to convert them dynamically to regular panels on Page_Load or Page_Init or something based on whether the page is being edited.
I'd like to convert all the UpdatePanels on a page to Panels dynamically. Finding the UpdatePanels isn't an issue, all my pages inherit from a common base class, and all my controls inherit from a common base class -- so I can override the Page_Init or whatever.
I suspect I can't covert the UpdatePanel to a regular Panel. I thought about maybe finding the UpdatePanel, adding a Panel to the UpdatePanel's parent, then looping through each of the UpdatePanel's controls and adding them to the new Panel, then removing the UpdatePanel.
But if I add a new Panel, it'll be at the end, can you add a Panel in the middle... maybe with Insert? This shouldn't be difficult, but am I making it too difficult? Is there a simpler way? Anybody ever done stuff like this?
Update I ended up override the OnInit function on my MasterPage base class to readd the UpdatePanel to the ScriptManager after it moved per Philippe's comment on [URL]
protected override void OnInit(EventArgs e) { if (Page is CMSPage && Page.IsDesignMode()) { foreach (UpdatePanel up in this.FindControls<UpdatePanel>())
i get some data from imdb using regexwhen getting title like Miller's Crossing and inserting it to my database there is a problemi get data and write on screen Response.Write(imdb.Title) it shows as Miller's Crossing that is the correct onebut after insert it to my database in Title field of table it is shown as Miller's Crossing so i dont want thishow can i convert those special characters when inserting to my datasbase ?
My querystring is a long URL to a repository node...is there a way to encrypt it such that it's not humand readable and I can just convert it back in my code behind?
Is there anyway I can encode my asp.net source code?
I really don't want my customer to steal my vb source code. They refused to pay extra for the source code and license. So we need to convert vb file to dll or encode(encrypt) vb source code that no one can understand the logic or decode(decrypt).
I inherited an application written for VB.Net and am converting it over to ASP.Net, with VB as the back end. I have a data pull that adds values to a new instance of a class, then adds the item to a listbox. It worked great in the VB.Net version, but I get the following error in the Visual Studio Text Editor when I try to use the code:
Overload resolution failed because no accessible 'Add' can be called with these arguments:
'Public Sub Add(Item As System.Web.UI.WebControls.ListItem)':Value of type 'MyItem' cannot be converted to System.Web.UI.WebControls.ListItem'. 'Public Sub Add(Item as String)':Value of type 'MyItem' cannot be converted to String.
I have played around with the code quite a bit and have been researching online, but I'm just drawing a blank here.
I put the class("MyItem") in the "App_Code" folder in a file called "MyItem.vb". The class code is as follows:
[Code]....
The code I have for the sub that is supposed to add the items to the listbox is as follows:
I have coded random string as below and i want to convert it to qr code , then send to email automatically...
Dim chars As String = "Test1" Dim qr As String = "" Dim r As New Random() Dim i As Integer For i = 1 To 5 qr += chars.Substring(r.Next(chars.Length), 1) Next
How can I convert the following aspx code into code behind code?
[Code]....
I want the following code to be craeated on the fly (runtime). I will only add the root level grid to aspx and then in page load I want to add subsequent grids.I know we will use GridViewTemplate to add the grid but not sure how to structure it. The steps that I follow:
1. set the required properties of gridLevel01.
2. add BoundFields for level01.
3. Add template field for level02 grid....but not sure how to set other required properties like color and stuff....also not sure what position to add the subsequent gridviews.
Do I need to add the child grids to root?? I know the level2 grid will be added to level1 but what about level 3?