|
Please be more specific.How do i set onmouseover and onclick event to each row. How can the onclick event trigger the selectionchanged event.
|
|
|
|
|
Hi Guys,
I'm facing a problem in serializing a class object in VB.Net. In this case, the
class contains two public properties and an arraylist . Class structure and Code for
serialization are given below. It serializes only the public properties, not the
arraylist. It throws a "System.InvalidOperationException..The type Photos was not
expected. Use the XmlInclude or SoapInclude attribute to specify types that are not
known statically". I have no idea about where to include these attributes... Pls
help..
<br />
'Class Definition<br />
<br />
<Serializable()> _<br />
Public Class SitePhotos<br />
Private _Outdoordesc As String<br />
Public Property Outdoordesc() As String<br />
Get<br />
Return _Outdoordesc<br />
End Get<br />
Set(ByVal value As String)<br />
_Outdoordesc = value<br />
End Set<br />
End Property<br />
<br />
Private _ShelterEntrance As String<br />
Public Property ShelterEntrance() As String<br />
Get<br />
Return _ShelterEntrance<br />
End Get<br />
Set(ByVal value As String)<br />
_ShelterEntrance = value<br />
End Set<br />
End Property<br />
<br />
'Arraylist to store photo descriptions<br />
<br />
Public _PhotoList As New System.Collections.ArrayList<br />
<br />
Public Sub AddPhoto(ByVal photoObj As Photos)<br />
_PhotoList.Add(photoObj)<br />
End Sub<br />
<br />
Public Sub RemovePhoto(ByVal range As String)<br />
Dim _pht As Photos<br />
'Dim i As Integer<br />
<br />
<br />
For Each _pht In _PhotoList<br />
<br />
If _pht.posRange = range Then<br />
_PhotoList.RemoveAt(_PhotoList.IndexOf(_pht))<br />
End If<br />
<br />
Next<br />
<br />
End Sub<br />
<br />
<br />
Public ReadOnly Property PhotoList() As ArrayList<br />
Get<br />
Return _PhotoList<br />
End Get<br />
End Property<br />
<br />
End Class<br />
<br />
'Structure of each photo description<br />
Public Structure Photos<br />
Public Pos As Integer<br />
Public Desc As String<br />
Public posRange As String<br />
End Structure<br />
<br />
<br />
<br />
'Code for serialization<br />
<br />
Dim extraTypes(0) As Type<br />
<br />
extraTypes(0) = GetType(SitePhotos)<br />
<br />
Dim xSerializer As XmlSerializer = New<br />
XmlSerializer(GetType(GeneralSiteInfo.SitePhotos), extraTypes)<br />
<br />
Dim xWriter As StringWriter = New StringWriter()<br />
<br />
' Since the serialization can exception, we'll encase it in a try/catch<br />
' mechanism, so we can report the error properly<br />
<br />
Try<br />
xSerializer.Serialize(xWriter, objPhotos)<br />
<br />
'xmlSitePhotos is a hidden control to which i can store value. <br />
<br />
_xmlSitePhotos.Value = xWriter.ToString()<br />
<br />
Catch ex As Exception<br />
<br />
MsgBox(ex.ToString())<br />
'MsgBox("Could not serialize Site Photos", MsgBoxStyle.Critical, "Error<br />
Saving Site Photos")<br />
<br />
End Try<br />
<br />
xWriter.Close()<br />
<br />
thanks,
Sebastian
-- modified at 13:09 Friday 9th February, 2007
|
|
|
|
|
Hi all,
I want to create a TextBox or a editable Dropdownlist which lists all employee name when i type the first letter and shows the names starting with that letter. Is there a control provided by .NET.
Note: The names are populated from the database.
How do i achieve this.Help!!!its urgent
|
|
|
|
|
check out the AjaxControlToolkit, it has something similar to this.
|
|
|
|
|
you can copy data to arraylist sort it and put back to control
or sort the data at database level by using in your sql query - ORDER BY [field name].
|
|
|
|
|
Someone here already implemented valid W3C Xhtml pages, using Microsoft ASP.Net Ajax?
Engaged in learning of English grammar
For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.(John 3:16)
|
|
|
|
|
|
Greetings!
Rolled out an upgrade to our intranet site yesterday evening and we suspect that the FormsAuthentication code may have become corrupted. To that end, we've tried recompiling and redeploying to no avail. Everything works as per design in DEV, but the LIVE site is not cooperating and we were forced to rollback the upgrade.
Anyway, I'm looking for ideas on how to analyze and possibly fix the FormsAuthentication code without having to re-install software, etc.
Any assistance is most appreciated! Thanks!
Code forth and prosper...
kIT
|
|
|
|
|
You know it is kind of hard to suggest much without having any error messages etc.
Some questions:
Do you have a testing server that you can use to test the release?
Did you upgrade from .net 1.1 to 2.0?
Did you add some new code that is doing file handling?
Are you using asp 2.0 with the roles?
Anyway those are a couple of questions that come to mind.
If you upgraded from 1.1 to 2.0 you need to mark the web site as a 2.0 site or it won't work. Go into iis manager and get to the properties of the web site. If you have asp.net 2.0 framework installed (which could be another issue if you upgraded) you should see an asp.net tab. In this tab you can set the site to be a .net 2.0 site.
If you added some new code that is doing something with files. Often this code will work fine locally, but once you get to the web server you need to properly set up rights. A lot of times you just need to give aspnet user and iis_wpg user the correct rights to folders.
If you are using asp.net 2.0 and you have done some stuff with the membership provider including having users in roles etc. You need to be careful that you have the web.config set up correctly for what pages users can access based off which roles they are in.
Well, anyway there are a few ideas. Kind of a shotgun approach since I don't really know what error you are seeing.
Hope it helps.
Ben
|
|
|
|
|
Thanks for the reply... My apologies for not being more succinct, I was simply posting my observations as I knew them at the time.
Anyway, it turns out that an experiment with SmartNavigation in the Web.Config file that worked in DEV, did not work in LIVE. So we stripped it out for now and everything compiled and deployed as expected.
Thanks!
Code forth and prosper...
kIT
|
|
|
|
|
Dear All,
I am using C# , asp.net(visual studio 2005)
i have generated crystal report using Crystalreportviewer which also show pring and export option Now i want to export data from report to Excel or
Pdf or word How i can i do it. please suggest me some link or example
Thanks
regards
imran khan
|
|
|
|
|
hi
i dont know write english but its is the code
CRPepeletaAA.SetDataSource(dsCapturaTransfer1);
CRVieFormatoAA.ReportSource=CRPepeletaAA;
MemoryStream oStream; // using System.IO
oStream = (MemoryStream)CRPepeletaAA.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
this part:
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
and: application/pdf you can change and select the type format that you want
i hope can i help you
sorry but my bad english.
|
|
|
|
|
How to update or delete direct from Grid to Database?I tried my best but fail.Please help me.I have enclosed my code. Please modify
Private Sub Grid_Customer_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles Luoi_khach_hang.UpdateCommand
Dim Name1 As TextBox = e.Item.Cells(0).Controls(0)
Dim Name2 As TextBox = e.Item.Cells(1).Controls(0)
Dim Sex As CheckBox = e.Item.FindControl("Phai")
Dim Custom_Code As Integer = Luoi_khach_hang.DataKeys(e.Item.ItemIndex)
Dim SQL As String = "UPDATE khach_hang SET ho_khach_hang='" & Name1.Text & "',ten_khach_hang='" & name2.Text & "',gioi_tinh=" & Sex.Checked & " where mkh=" & Customer_Code
Dim Connect As OleDb.OleDbConnection = Bang_khach_hang.Connect
Connect.Open()
Dim cmd As New OleDb.OleDbCommand(sql, Connect)
Try
cmd.ExecuteNonQuery()
Catch ex As Exception
End Try
Connect.Close()
Grid_Customer.EditItemIndex = -1
Doc_danh_sach_khach_hang()
Lien_ket_du_lieu()
End Sub
|
|
|
|
|
|
I see you use Datareader.But I don't use it.I am using Datatable.Please give code in Datatable.Anyway I would be grateful.Thanks very very very much much much
|
|
|
|
|
I forget that . My application alerts the strange error is that: operation must use an updateable query.
But my query is very exactly
|
|
|
|
|
Struggeling here, suspect isue maybe related to versionof .NET framework installed. How can I determine what version is installed?
|
|
|
|
|
Check folder in C:\WINDOWS\Microsoft.NET\Framework or look in add/remove programs (you can have every version installed on the same machine btw)
|
|
|
|
|
Since you don't say what exactly you are struggling with, you may like to check in IIS also. If you have 1.x and 2.0 installed then an extra tab appears in the properties for your virtual directory which allows you to choose the version of the .NET framework your ASP.NET application will use.
|
|
|
|
|
I am very new to .NEW web, a couple years ago I struggled through making a very simple page that would allow you to hit a SQL database and retrieve some info.
I went to open the project recently and got an error "Unable to get the project file from the Web server. Unable to open Web Project 'IBEReports_2_2005'. The file path "w:\inetpub\wwwroot\IBEReports_2-2005' does not corrospond to the URL 'http://localhost/IBEreports_2-2005' The two need to map to the same server location. HTTP Error 404: Object Not found.
I tried to open the project from my c:\inetpub\wwwroot\IBEReports_2-2005 directory, and also from the server (on the W drive), same issue.
In IIS I have an alias pointing to the C:\Inetpub\wwwroot\IBEReports_2-2005.
So then I backed up a bit anf figured I would just try a blank project and try to get my feet back on the ground from square 1...
I Open Visual Studio .NET 2003, Select "New Project", Select "ASP .NET Web Application", give it a name and receive and error:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'WebApplication1.Global'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="WebApplication1.Global" %>
I posted a question about this error and was told I needed to build the project, which I did, and I get the dll files in the project \bin directory, but I stil get the same error
Which led me to this whole things about the .NET framework,
It has been so long I do not recall exactly how I set it up and was wondering if my wonderful IT department possibly changed the ,NET framework version, a hint I got from google...
any help is greatly appreciated I am pulling my hair (what is left of it) out at this point...
Oh... and yes, I do see the extra tab...but still have the same problems after installing .NET framework 2.
|
|
|
|
|
Hrmph... think I got it, I completely removed virtual directories, re-booted added themback and seem to havestraigentened everything out...
it works now...
|
|
|
|
|
dear Friends,how can i draw the graph in the asp.net by taking the data from the database.
Plz help me out.
Subbu.
|
|
|
|
|
|
Hi!
i have an iFrame in my asp.net application. i have change the src of the iFrame depending upon the button clicked. i want to pages in the iFrame in the center. How can achieve this???
Thanks & Regards,
SAMir Nigam,
Software Developer,
STPL, Lucknow, India.
|
|
|
|
|
You can do that with Javascript, Just wire a javascript function to an OnClientClick event of your Button.JS function can look like this:
<br />
function SetIFrame()<br />
{ <br />
document.all.Your_IFame_Name.src='www.google.com';<br />
}<br />
|
|
|
|