Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

shapper

@shapper
About
Posts
201
Topics
148
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • List problem. Please, help me out.
    S shapper

    Hello, I created a form which is built mostly with ordered lists: http://www.27lamps.com/public/Beta.htm I am having a few problems. All of them inside a DIV to which I am applying the class "ListBox" 1. ListBox is not being applied to the child tags of that DIV, i.e., OL and LI. They have the styles defined by parent class. How can I solve this? 2. My second problem is how to clear floats on my ol. I applied the overflow approach to my OL tag but this does not seem to work. Note that I am trying to display 3 LI per row simulating a table. Could someone, please, help me out? And I am open to any suggestion which might improve my CSS on this form. I have been working on this for quite a while but I know I can still improve it. Thank You, Miguel

    Web Development help question css wpf com

  • GridView - How to show a date header?
    S shapper

    Hello, I have created a GridView on runtime by implementing the ITemplate class. This Gridview displays a list of articles. Each article has a Title, Content and PubDate. I am trying to create a Date Header like in a blog, i.e., display the date on top of every daily posts. For example: Wednesday, 25 of April of 2007 Article 3 (PubDate: 25.04.2007 # 20:15) Article 2 (PubDate: 25.04.2007 # 11:30) Article 1 (PubDate: 25.04.2007 # 08:40) Wednesday, 24 of April of 2007 Article 2 (PubDate: 24.04.2007 # 21:32) Article 1 (PubDate: 24.04.2007 # 15:45) How can I created the date header as I described? Thanks, Miguel

    ASP.NET tutorial question

  • Profile
    S shapper

    Hello, I have an ASP.NET page and in its runtime code I am trying to get an user profile, change it and save it. It works if I use Profile, which is the profile for the current authenticated user. But I want to change the profile of another user. Anyway, I am using: 1 Dim pcProfile As ProfileCommon = CType(ProfileCommon.Create(Username), ProfileCommon) 2 3 ' Update personal 4 With pcProfile.Personal 5 .Blog = tbBlog.Text 6 .Homepage = tbHomepage.Text 7 .Name = tbName.Text 8 End With 9 10 pcProfile.Save() This is not working. What am I doing wrong? Thanks, Miguel

    ASP.NET

  • Find item in Generic List
    S shapper

    Hello, I have a generic list named Rows: Dim a As New Generic.List(Of Row) Row is a structure which has 2 properties: Name and Content. Is it possible, without a for loop, to find a Row in Rows which Name is "Home" and get its content? Thanks, Miguel

    ASP.NET

  • How to create these GridViews?
    S shapper

    Hello, I created 2 GridViews, A and B. I created 2 datasets from Asp.Net 2.0 profile data. Each GridView has a Bound Field and a Button Field. When a button on GridView A is clicked the following should happen: 1. Copy the Row to GridView B 2. Delete the Row from GridView A Finally, I have a button which would get the data from GridView A and GridView B. What is the best way to create this? And is GridView the best way to do this? Thanks, Miguel

    ASP.NET question csharp asp-net tutorial

  • Data type. Multi pair of values. How can I do this?
    S shapper

    Hello, I need to pass to a function a list of pairs of values. For each item the first value is a string and the second value is an Enum named Country. For example, consider I need to pass 3 items: "New York", Country.UnitedStates "Paris", Country.France "London", Country.England What data type should I use create this? And how can I access each item inside my function? Thanks, Miguel

    ASP.NET question tutorial

  • Check if record exists
    S shapper

    Hello, I created the following SQL script to check if a record exists: IF (EXISTS (SELECT LevelName FROM dbo.by27_Levels WHERE LOWER(@LevelName) = LOWER(LevelName))) Return (1) ELSE Return (0) And I also found in a web page another solution: IF EXISTS(SELECT 1 FROM TABLENAME WHERE LevelName=@LevelName) SELECT 1 ELSE SELECT 0 - Which approach should I use? - Why "SELECT 1 FROM"? - And when should I use SELECT or RETURN? All I need is to know if the record exists ... nothing else. I will use this procedure on an ASP.NET 2.0 / C# web site. I am not sure if this important but anyway ... Thank You, Miguel

    ASP.NET csharp asp-net database tools question

  • Grid problem
    S shapper

    Hi, To be honest I am not able to debug and see what is inside container.DataItem("Name"). However, in the code I posted I have the function which creates the DataTable: Public Shared Function Collaborators() As DataTable ' Create collaborators data table Dim dtCollaborators As New DataTable ' Add columns to collaborators data table With dtCollaborators.Columns .Add(New DataColumn("Name", GetType(String))) .Add(New DataColumn("Mobile", GetType(String))) .Add(New DataColumn("Email", GetType(String))) .Add(New DataColumn("City", GetType(String))) End With ' Create and add a new collaborator row Dim drRow01 As DataRow drRow01 = dtCollaborators.NewRow ' Define collaborator row values drRow01("Name") = "John" drRow01("Mobile") = "983498223" drRow01("Email") = "john@mydomain.com" drRow01("City") = "New York" ' Add row to collaborators data table dtCollaborators.Rows.Add(drRow01) ' Create and add a new collaborator row Dim drRow02 As DataRow drRow02 = dtCollaborators.NewRow ' Define collaborator row values drRow02("Name") = "Andrew" drRow02("Mobile") = "983498223" drRow02("Email") = "andrew@mydomain.com" drRow02("City") = "Paris" ' Add row to collaborators data table dtCollaborators.Rows.Add(drRow02) ' Return collaborators data table Return dtCollaborators End Function ' Collaborators It seems ok, right? What should I do? How can I see what is inside container.DataItem("Name") as you mentioned? Thank You, Miguel

    ASP.NET csharp help css asp-net

  • Grid problem
    S shapper

    Hi, I read carefully what you wrote and I got the same error after making a few changes to my code. This is what I did: ' InstantiateIn Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn ' Define template container Dim tcCollaborator As ComponentArt.Web.UI.GridServerTemplateContainer = CType(container, ComponentArt.Web.UI.GridServerTemplateContainer) ' Add lCollaborator data binding handler AddHandler lCollaborator.DataBinding, AddressOf lCollaborator_DataBinding ' Add item template child controls container.Controls.Add(lCollaborator) End Sub ' InstantiateIn ' lCollaborator_DataBinding Private Sub lCollaborator_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) ' Create and define lCollaborator Dim lCollaborator As Label = CType(sender, Label) ' Create and define lNews container Dim container As ComponentArt.Web.UI.GridServerTemplateContainer = CType(lCollaborator.NamingContainer, ComponentArt.Web.UI.GridServerTemplateContainer) ' Define lCollaborator text lCollaborator.Text = "Name: " & container.DataItem("Name").ToString End Sub ' lCollaborator_DataBinding Any idea? I am completely out of ideas ... Thanks, Miguel

    ASP.NET csharp help css asp-net

  • Grid problem
    S shapper

    Hi, sure. I just debugged and I get an error in the following line: lCollaborator.Text = "Name: " & tcCollaborator.DataItem("Name").ToString I though it was because of tcCollaborator.DataItem("Name").ToString But now I replaced this line by the following and I don't get any error: Dim a As String = tcCollaborator.DataItem("Name") Of course I don't see anything in my grid. Now I am confused. :-( Any idea? Thanks, Miguel

    ASP.NET csharp help css asp-net

  • Grid problem
    S shapper

    Hello, I am trying to create a ItemTemplate at runtime for a ComponentArt Grid. This GridView works in a very similar way to the Asp.Net 2.0 GridView so the implementation method should be the same. When I don't use the ItemTemplate everything works fine. However, when I use the ItemTemplate I get the following error: "Exception Details: System.NullReferenceException: Object reference not set to an instance of an object." On the code line lCollaborator.Text = tcCollaborator.DataItem("Name").ToString & tcCollaborator.DataItem("City").ToString I think my problem is really the binding method. Could someone please tell me what might be wrong? I also tried using the Asp.Net 2.0 GridView and I am getting the same problems. I post my VB.NET code. Please, fell free to answer in VB.NET or C#. GRID.aspx.vb 1 Partial Class Grid 2 Inherits System.Web.UI.Page 3 4 ' -- [Controls] ------------------------------------------- 5 6 Protected WithEvents cagCollaborators As New ComponentArt.Web.UI.Grid 7 8 9 ' -- [Events and Methods] ------------------------------------------- 10 11 ' Page_Init 12 Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init 13 14 phGrid.Controls.Add(cagCollaborators) 15 16 End Sub ' Page_Init 17 18 ' Page_Load 19 Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load 20 21 ' Create grid server template 22 Dim cagstCollaborators As ComponentArt.Web.UI.GridServerTemplate = New ComponentArt.Web.UI.GridServerTemplate() 23 24 ' Create grid template 25 Dim gitCollaborators As GridITemplate = New GridITemplate 26 cagstCollaborators.Template = gitCollaborators 27 cagstCollaborators.ID = "cagstCollaborators" 28 29 ' Add grid server template to grid 30 cagCollaborators.ServerTemplates.Add(cagstCollaborators) 31 32 ' Create grid column 33 Dim gcCollaborators As ComponentArt.Web.UI.GridColumn = New ComponentArt.Web.UI.GridColumn 34 gcCollaborators.DataCellServerTemplateId = "cagstCollaborators" 35 36 ' Create grid level 37 Dim glCollaborators As New ComponentArt.Web.UI.GridLevel 38 glCollaborators.Columns.Add(gcCollaborators) 39 40 ' Add grid level to grid 41 cagCollaborators.Levels.Add(glCollaborators) 42 43 ' Bind grid 44 cagCollaborators.DataBind() 45 46 End Sub ' Page_Load 47 48 ' {Grid} ... 49 50 ' cagCollaborators_Init 51 Private Sub cagCollaborators_Init(ByVal sender As Object, ByVal

    ASP.NET csharp help css asp-net

  • Create Profile. Going crazy ...
    S shapper

    Hello, I am creating a new profile to a user: Dim profile As ProfileCommon = CType(ProfileCommon.Create(user.UserName, True), ProfileCommon) With profile.Contact .City = tbCity.Text .District = CType(Int32.Parse(ddlDistrict.SelectedItem.Value), Enumeration.District) End With With profile.Options .Newsletter = cbNewsletter.Checked End With profile.Save() I get the error: Type 'System.Web.Profile.ProfileBase' in Assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable. Contact and Options are classes with properties and a few methods which are defined as: _ Public Class Options ... And in my Web.Config, under profile, I have: Any idea what might be going on? Thanks, Miguel

    ASP.NET help question announcement

  • Enum [modified]
    S shapper

    Hello, I have the following: ' Loop through each color enumeration name For Each color As Color In [Enum].GetNames(GetType(Color)) Dim name As String = MyF(color, Thread.CurrentThread.CurrentCulture) Dim index As Integer = CType(color, Enumeration.District) Response.Write("Name: " & name & " | Index: " & index.ToString & "
    ") Next I think this is working but I am not sure if this is the best way to solve this. Note: MyF is a function with a Select Case block which returns a string giving a enum element and a culture. I need this. However, I now need to get the text of an element by giving its index. For example, get "Red" when I say 1. Could someone help me out? Thanks, Miguel

    ASP.NET database help question

  • Enum [modified]
    S shapper

    Hello, I have an enum: Public Enum Color Red Blue Green End Enum I need: 1. Loop trough all enum items and get each one value (Ex: Red) and index (Ex: 1). For Each color As Color In [Enum].GetValues(GetType(Color)) ??? Next 2. Get an enum value (Ex: Red) by providing its index (Ex: 1) I tried various options but I am not able to make this work. Thank you for your Help, Miguel -- modified at 15:05 Friday 12th January, 2007

    ASP.NET database help question

  • Check User
    S shapper

    Hello, I am creating a Poll system and I need to check if a user has already voted. What should be the best way to do this? 1. Should I save the user IP along with its vote in the database? But does not some users IP change each time they access the internet? 2. Should I place a cookie in after the user voted? Well, any help will be great. Thanks, Miguel

    ASP.NET database help question

  • Nested Master Pages
    S shapper

    Hello, I am creating a web site with Nested Master pages. I also need to have a class where the culture is set. When the culture is changed by the user the page refreshes and the change takes effect. I saw this approach, I think, on a MSDN web site or blog: Config.vb > Class where culture is set from profile value _Base.master > Parent master page ( _Navigation > Child master page) Default.aspx.vb > Page I have this working without the child master page _Navigation. I can't make this work with the child master page. Could someone help me out with this? This is the code for my 3 working pages (Config.vb, _Base.master and Defaul.aspx.vb) ----- Config.vb ----- 1 Public Class Config 2 Inherits Page 3 4 Sub Page_PreInit(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.PreInit 5 Response.Write("Config") 6 Page.Theme = CType(Context.Profile, ProfileCommon).Config.Theme 7 End Sub 8 9 Protected Overrides Sub InitializeCulture() 10 MyBase.InitializeCulture() 11 Dim language As String = CType(Context.Profile, ProfileCommon).Config.Language 12 If (language IsNot Nothing) AndAlso (language <> "Auto") Then 13 MyBase.UICulture = language 14 Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(language) 15 End If 16 End Sub 17 18 End Class ----- Base.master.vb ----- 1 Partial Class _Base 2 Inherits System.Web.UI.MasterPage 3 4 Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init 5 Response.Write("Base.master") 6 End Sub 7 8 End Class 9 10 ----- Default.aspx.vb ----- 1 Partial Class _Default 2 Inherits Config 3 4 Protected Overloads Sub Page_PreInit(ByVal sender As Object, ByVal e As EventArgs) Handles Me.PreInit 5 Me.MasterPageFile = "~/_Base.master" 6 End Sub 7 8 Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init 9 Response.Write("Default.aspx") 10 End Sub 11 12 End Class Could someone help me out in integrating a Child Master page between _Base.master and Default.aspx? Thanks, Miguel

    ASP.NET design help question

  • Web Site Optimization and Verification
    S shapper

    Hello, I am having some speed problems with an Asp.Net 2.0 web site and I would like to know if there is some tool which accesses a web site and displays each step of when the web site is loading. I need to figure out what is taking a long time to load or a error hapening. Thanks, Miguel

    Web Development performance csharp asp-net algorithms help

  • Email Error
    S shapper

    Hello, I have a contact form in my web site which is working just fine on my computer! When I uploaded my web site to my hosting server I get an error when I SUBMIT my form, i.e., when I click submit to send the email: Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. 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: [SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0 System.Security.CodeAccessPermission.Demand() +59 System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +678 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +114 System.Configuration.Internal.InternalConfigHost.StaticOpenStreamForRead(String streamName) +80 System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName, Boolean assertPermissions) +115 System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.OpenStreamForRead(String streamName) +7 System.Configuration.Internal.DelegatingConfigHost.OpenStreamForRead(String streamName) +10 System.Configuration.UpdateConfigHost.OpenStreamForRead(String streamName) +42 System.Configuration.BaseConfigurationRecord.InitConfigFromFile() +443 Maybe the error comes from me getting data from Web.Config? I have this code inside a custom control but here it is: 1 Private Sub bSubmit_Click(ByVal sender As Object, ByVal e As Sys

    ASP.NET sysadmin hosting data-structures security debugging

  • Embed Resource. I can't figure this out.
    S shapper

    Hello, I have an assembly with customs controls, classes and handlers.I am creating it as an ASP.NET 2.0 VS2005 Web Project This one one of my handlers: Namespace Web Public Class SiteMap : Implements IHttpHandler Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim xslDoc As XslCompiledTransform = New XslCompiledTransform xslDoc.Load(Page.ClientScript.GetWebResourceUrl(Me.GetType, "MyProjectNamespace.Web.SiteMap.xsl")) >>> ERROR End Sub ... I get the error "Page is not declared". I also have the code line " " in my AssemblyInfo.vb file. And I set the Build Action of "SiteMap.xsl" to "Embedded Resource". I have been reading documentation in internet but I can't find the solution. Could someone help me out? Thank You, Miguel

    ASP.NET help csharp asp-net hardware xml

  • XSL. Please, need help. Thank You.
    S shapper

    Hello, I created a XSL file to convert a XML file to another XML. I am running this in Asp.Net but this is not working. ----- ORIGINAL XML ----- ----- What XML result should be (Domain Parameter = "http://www.domain.com") ----- < urlset xmlns="http://www.google.com/schemas/sitemap/0.84"> < url> < loc>http://www.mydomain.com/Contacts.aspx < changefreq>daily < lastmod>2006-11-01T20:25:42+01:00 < priority>0.4 ----- XSL ----- Could someone, please, tell me why is this not working? And is there a software or web site where I can test a XSL conversion? Thanks, Miguel

    XML / XSL xml csharp asp-net com help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups