|
|
Hi all,
I am posting this thing second time as i m not able to solve this yet.
I have a dataset and a link(a href). when somebody click on that, the data from the dataset should be downloaded in to the excel file.i m working in sharepoint portal and creating web part using C#.I surf forums, which has the solution for this.But it include creating a class and a method. The thing is that, we dont have any onclick event for HyperLink in ASP.NET. if any solution with javascript, that's good too.If, any body can help me in this problem it would be appreciated.
Thank you very much.
NIKI
|
|
|
|
|
hi,
You can create DTS package for this. DTS package will accept the DS as parameter and fill the sheet. In excel sheet you have to make template with the name range. So, while filling the excel sheet, DTS package refer that name range.
Naishadh Mandaliya
|
|
|
|
|
Hi Naishadh,
Thanks for the quick response.
But, to be very honest, I am new in the sharepoint environment.I know, how to export data to excel in asp.net,but not in sharepoint.If you can give me some details or some type of code, that will be great for me.
Thanks,
NIKI
|
|
|
|
|
I have hosted a site through some hosting site...Well...After i had uploaded the pages, it worked fine whole night..But without any changing the code or anything else also...Now all of a sudden it shows the error to be
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.
Exception Details: System.Security.Policy.PolicyException: More than one exclusive group is not allowed.
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:
[PolicyException: More than one exclusive group is not allowed.]
System.Security.Policy.PolicyLevel.GenericResolve(Evidence evidence, Boolean& allConst) +2723202
System.Security.Policy.PolicyLevel.Resolve(Evidence evidence, Int32 count, Char[] serializedEvidence) +124
System.Security.PolicyManager.CodeGroupResolve(Evidence evidence, Boolean systemPolicy) +182
System.Security.PolicyManager.ResolveHelper(Evidence evidence) +95
System.Security.HostSecurityManager.ResolvePolicy(Evidence evidence) +32
System.Security.PolicyManager.Resolve(Evidence evidence) +72
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +148
System.Security.SecurityManager.ResolvePolicy(Evidence evidence
and much more trace is done..Can someone please tell me whether the problem is with my coding now or with webserver hosting company..so than i can ask them in detail whats wrong with my site now...
|
|
|
|
|
Hi ,
as you know in asp.net 2.0 you can go to the menu select web site & then asp.net web site configuration like that you can configure tracing , debuging , security , roles ....
but in asp.net 1.1 (VS 2003) i didn't find that item in the menu neither (asp.net web site configuration)
can you tell me where can i find those items please ?
thank you very much
try to be good if you can't be the best
|
|
|
|
|
Hi there,
This menu item is only supported in VS 2005, in VS 2003 with the ASP.NET 1.1 you may look for a third party configuration tool like this one[^].
|
|
|
|
|
Hi thanks but do you mean i have to purchase this software to configure my application ? i think vs 2003 supports something else that allows doing the same stuff but i didn't find it
you said i have to look for a configuration tool , i sought for it but i found nothing,can you tell me where can i find that please ?
try to be good if you can't be the best
|
|
|
|
|
hello
I need a link that can help me how can I create crystal report in Asp.net (Vb.net2005) ( for begining )
thanks for your help
dadax
|
|
|
|
|
|
I have been experimenting with placing user controls (using Windows Forms controls) into an ASP.NET webpage - and am completely stuck. I can get a blank user control to work, but nothing beyond that. I have tried making a very basic test rig to isolate the problem, and have illustrated it below. For reference, this is using .NET 2 and Visual Studio 2005.
Here's what I did - the first few steps explain what worked, then what I did that broke it. If anybody can see the obvious thing I'm missing, I'd love to hear from you.
1. Create a new "Control Library" solution - call it "UserControlTestRig"
2. Modify the background color of the default control (UserControl1)
3. Compile, and test. The user control debug form pops up, and it works fine.
4. Add a new ASP.NET website to the solution
5. Copy the compiled DLL of the user control to the root dir of the website
6. Refresh the explorer in Visual Studio (to stop it complaining further on)
7. Add the following to the default.aspx page...
<object id="uc1"
classid="UserControlTestRig.dll#UserControlTestRig.UserControl1">
</object>
8. Run the webpage - it appears, as does the user control with it's background
color as set when we built it.
All is fine so far. Next I do the following, and have no idea why it breaks...
9. Edit UserControl1 - add a label control to it (from the standard windows form
controls)
10. Recompile UserControl1, and copy the DLL over to the web page.
11. Re-open the webpage, to see the usercontrol with the label...
*The control no longer works.*
What's more, once the control is broken, you can't then recompile without the label, re-copy, and run the webpage again...
If somebody can explain why this is happening I'd love to know.
The maddening thing is I have a fairly complex series of controls that this happened to this morning, and have spent all afternoon slowly going backwards until I got to this example - at which point I held my hands up and said "I'm going to ask on the internet"...
|
|
|
|
|
Getting somewhere... it's *something* to do with replacing the user control DLL.
If I re-compile the user control and replace the one in the web root, the webpage no longer shows the object.
If I destroy the website and make it again, it works once more - and (as you might predict) if I rebuild the user control again, the webpage no longer shows it...
Any ideas why ???
|
|
|
|
|
You may try to delete the Download cache with the command gacutil /cdl , then launch the web page again in a new browser.
|
|
|
|
|
I found *a* solution to it late last night.
The behaviour (recompiled user controls vanishing) only occurs in the Visual Studio 2005 web server. If you create an IIS website and put the compiled user control there, it works.
Therefore (at this time) I can only deduce that the problem - if it is a problem - exists with the mini webserver built into VS2005.
Hope this helps somebody else one day...
|
|
|
|
|
|
I click on one particular link which goes to a particlar aspx page. However, sometimes I just get an about:blank page. I don't think it's spyware as I've tried it on different PC's!
|
|
|
|
|
breen25 wrote: However, sometimes I just get an about:blank page.
is it showing the right page sometimes???
Sushant Duggal.
|
|
|
|
|
|
|
I have a datagrid with a link button column.
By clicking on this link button, i want a modal dialog to be opened
hoooowwwww?
|
|
|
|
|
You may need to do the following steps:
+ Create an event handler for the ItemDataBound event of the datagrid control.
+ Get reference to the link button.
+ Add the handler for the client event onclick of the linkbutton using the Attributes collection with the Add method, in the handler you'd call to show up the modal dialog box.
You can find the sample code from the site datagridgirl[^].
|
|
|
|
|
Hi all,
I'm currently trying to add (with a button) rows into tables (html table, asp table or gridView) .
I've tried : (asp:Table)
Private Sub AddRow()
Dim count As Integer = procTable.Rows.Count //never increment !!!
Dim myRow As New TableRow
Dim myCell As New TableCell
myCell.Text = "myCell"
myRow.Cells.Add(myCell)
'this is the asp:Table
procTable.Rows.AddAt(count, myRow)
End Sub
Had anyone an idea???
Thanks a lot
ElpenS
-- modified at 10:26 Tuesday 4th July, 2006
ElpenS
|
|
|
|
|
Hi ElpenS,
I work in C#, so i can give u an idea , what i think about the problem.
In C# when we create a new row , we create a new row for the table.
i.e.
TableRow tr = procTable.newRow();
And then at last we add the row to the table.
procTable.Rows.Add(tr);
I hope it works,
Thanks
Sushant Duggal.
|
|
|
|
|
Thanks to you for your reply,
Unfortunatly, it doesn't works in VB.net.
procTable.newRow is not defined.
Will wait on further messages...
Have a nice day
ElpenS
|
|
|
|
|
I can't take it any longer... Can someone pleaseeeee help me. I have included my code below. I have searched everything and read many articles but I still don't get it. So please no reaction in the sense; you must create your controls in page_load, you must recreate your controls in the onpageinit, preserve viewstate, etc. because I have seen all those matters, many many times. My guess is that I just miss a tiny bit...
On a webform I have a placeholder and in codebehind this placeholder is filled with 2 dropdownlists and two buttons. The two lists are filled with data from a dbase. When a user clicks one button an item is transfered from one list to the other, vice versa. What happens in code below is that I have to click a button twice to have an item move. Actually the first time when I click the button the item is transfered but the list wont refresh, while I regenerate the listboxes in my on page init (i tried the on postback as well). When I do a response.redirect to the same page it works fine but that shouldn't be the way to go.
Imports System.Data.SqlClient
Imports System.Data
Partial Class Beheer_viewstate
Inherits System.Web.UI.Page
Dim bID As Integer
Sub Page_Init(ByVal s As Object, ByVal e As EventArgs) Handles MyBase.Init
Session("boekingID") = 105
bID = 105
dynamiccontent()
End Sub
Sub dynamiccontent()
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("MyProvider"))
conn.Open()
'ongeboekte extras per reiziger
Dim get_boeker_ongeboekte_extras As New SqlCommand("get_boeker_ongeboekte_extras", conn)
get_boeker_ongeboekte_extras.CommandType = CommandType.StoredProcedure
get_boeker_ongeboekte_extras.Parameters.AddWithValue("@boekerID", bID)
get_boeker_ongeboekte_extras.Parameters.AddWithValue("@boekingID", Session("boekingID"))
Dim rdr_get_boeker_ongeboekte_extras As SqlDataReader = get_boeker_ongeboekte_extras.ExecuteReader()
Dim extras As New ListBox
extras.ID = "lbx_extras" & bID
extras.DataSource = rdr_get_boeker_ongeboekte_extras
extras.DataValueField = "extraID"
extras.DataTextField = "naam"
extras.EnableViewState = "true"
extras.DataBind()
rdr_get_boeker_ongeboekte_extras.Close()
'geboekte extras
Dim get_boeker_geboekte_extras As New SqlCommand("get_boeker_geboekte_extras", conn)
get_boeker_geboekte_extras.CommandType = CommandType.StoredProcedure
get_boeker_geboekte_extras.Parameters.AddWithValue("@boekingID", Session("boekingID"))
get_boeker_geboekte_extras.Parameters.AddWithValue("@boekerID", bID)
Dim rdr_get_boeker_geboekte_extras As SqlDataReader = get_boeker_geboekte_extras.ExecuteReader()
Dim gekozenextras As New ListBox
gekozenextras.ID = "lbx_gekozenextras" & bID
gekozenextras.DataSource = rdr_get_boeker_geboekte_extras
gekozenextras.DataValueField = "extraID"
gekozenextras.DataTextField = "naam"
gekozenextras.EnableViewState = "true"
gekozenextras.DataBind()
rdr_get_boeker_geboekte_extras.Close()
'knopje voor toevoegen
Dim extrastoevoegen As New Button
extrastoevoegen.CssClass = "btn"
extrastoevoegen.Text = "-->"
extrastoevoegen.EnableViewState = "true"
extrastoevoegen.CommandName = "myId"
extrastoevoegen.CommandArgument = bID
AddHandler extrastoevoegen.Command, AddressOf extrastoevoegen_Click
'knopje voor verwijderen
Dim extrasverwijderen As New Button
extrasverwijderen.CssClass = "btn"
extrasverwijderen.Text = "<--"
extrasverwijderen.EnableViewState = "true"
extrasverwijderen.CommandName = "myId"
extrasverwijderen.CommandArgument = bID
AddHandler extrasverwijderen.Command, AddressOf extrasverwijderen_Click
plh_reizigers.Controls.Add(extras)
plh_reizigers.Controls.Add(extrastoevoegen)
plh_reizigers.Controls.Add(extrasverwijderen)
plh_reizigers.Controls.Add(gekozenextras)
End Sub
Sub extrastoevoegen_Click(ByVal Sender As Object, ByVal e As CommandEventArgs)
Dim extrastoevoegen As Button = CType(Sender, Button)
Dim myId As String = extrastoevoegen.CommandArgument
Dim lbx As ListBox = FindControl("lbx_extras" & myId)
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("MyProvider"))
conn.Open()
Dim set_boeker_extra As New SqlCommand("set_boeker_extra", conn)
set_boeker_extra.CommandType = CommandType.StoredProcedure
set_boeker_extra.Parameters.AddWithValue("@boekingID", Session("boekingID"))
set_boeker_extra.Parameters.AddWithValue("@extraID", lbx.SelectedValue)
set_boeker_extra.Parameters.AddWithValue("@boekerID", myId)
set_boeker_extra.ExecuteNonQuery()
conn.Close()
lbx.SelectedIndex = -1
End Sub
Sub extrasverwijderen_Click(ByVal Sender As Object, ByVal e As CommandEventArgs)
Dim extrasverwijderen As Button = CType(Sender, Button)
Dim myId As String = extrasverwijderen.CommandArgument
Dim lbx As ListBox = FindControl("lbx_gekozenextras" & myId)
Dim conn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("MyProvider"))
conn.Open()
Dim del_boeker_extra As New SqlCommand("del_boeker_extra", conn)
del_boeker_extra.CommandType = CommandType.StoredProcedure
del_boeker_extra.Parameters.AddWithValue("@boekingID", Session("boekingID"))
del_boeker_extra.Parameters.AddWithValue("@extraID", lbx.SelectedValue)
del_boeker_extra.Parameters.AddWithValue("@boekerID", myId)
del_boeker_extra.ExecuteNonQuery()
conn.Close()
lbx.SelectedIndex = -1
End Sub
End Class
|
|
|
|
|