|
Hi,
I having trouble with assigning dynamically checkbox's Checked value using values from a datatable.
Here's my code
<asp:checkbox runat="server" id="chk1" checked="<%# (DataBinder.Eval(Container.DataItem,"Enable")) %>">
How can i automatically convert the field Enable which is from datatable so it will be assigned as Checked's value?
That field's type is bool and values 0 or 1.
Many Thanks!
|
|
|
|
|
Checked='<%# IIF(ISDBNULL(Eval("dbFlg")),0,Eval("dbFlg")) %>'>
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
i made a Web Service project in visual studio 2008.
then added 2 "Web Service" files to the project.
Service1.asmx
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <system.web.script.services.scriptservice()> _
<system.web.services.webservice(namespace:="http://tempuri.org/")> _
<system.web.services.webservicebinding(conformsto:=WsiProfiles.BasicProfile1_1)> _
<toolboxitem(false)> _
Public Class Service1
Inherits System.Web.Services.WebService
<webmethod(true)> _
Public Function HelloWorld() As String
Session("foo") = "bar"
Return "Hello World"
End Function
End Class
Service2.asmx
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <system.web.script.services.scriptservice()> _
<system.web.services.webservice(namespace:="http://tempuri.org/")> _
<system.web.services.webservicebinding(conformsto:=WsiProfiles.BasicProfile1_1)> _
<toolboxitem(false)> _
Public Class Service2
Inherits System.Web.Services.WebService
<webmethod(true)> _
Public Function HelloWorld() As String
If Session("foo") <> "bar" Then
Throw New UnauthorizedAccessException
End If
Return "Hello World"
End Function
End Class
After i made a windows application, where i made a "Service Reference" to both web service classes/files.
The problem is that Service1.asmx doesn't share it's session with Service2.asmx,...
I get the thrown "UnauthorizedAccessException" on calling "Service2.HelloWorld()" because the session is not created in Service2.asmx after calling Service2...
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim bhp As New System.ServiceModel.BasicHttpBinding
bhp.AllowCookies = True
Dim x As New ServiceReference1.Service1SoapClient(bhp, New ServiceModel.EndpointAddress("http://localhost/ImsBrowserWebService/Service1.asmx"))
Dim y As New ServiceReference2.Service2SoapClient(bhp, New ServiceModel.EndpointAddress("http://localhost/ImsBrowserWebService/Service2.asmx"))
MsgBox(x.HelloWorld)
MsgBox(y.HelloWorld)
' Dim x As New localhost.Service1
' MsgBox(x.HelloWorld())
' Dim y As New localhost1.Service2
' MsgBox(y.HelloWorld())
End Sub
End Class
How to share the session between those files,... In Visual Studio 2003 it works fine when calling the service from javascript,... Now in visual studio 2008 with the soap client wizards it doesn't...
Any help would be welcome,
...
allowcookies="true"
|
|
|
|
|
hi mates,
i need help.
i have 2 modal window, page1.aspx and page2.aspx.
in page1.aspx, i have button to call page2.aspx.
in page2.aspx, i have gridview with command field select.
if i click the selected row, the values will go to page1.aspx which has textboxes.
and automatically close the page2.aspx and
refresh the page1.aspx.
how will i do that?
in my mind, i will have to put arguments in page1.aspx?somevalue=
but how will i refresh the page1.aspx.
thanks in advance.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
Having problems with free PDF library sharpPDF and allowing it to write PDF file to child directory within ASP.NET application. The PDF is created just fine in my development environment but when deployed to production application (on same computer just separate folder) I receive the below exception.
I tried several different things such as:
- adding <trust level="Full"> to my web.config file for the application.
- verifying NTFS security settings on app directory. Added IIS_WPG with modify privileges. IIS_USRS had modify access already. As well NETWORK SERVICE has modify privileges.
Let me know any suggestions.
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. <br />
<br />
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.<br />
<br />
Source Error: <br />
<br />
<br />
Line 97: }<br />
Line 98: <br />
Line 99: pDoc.createPDF(strOutputFilename);<br />
Line 100:<br />
Line 101: Response.ContentType = "Application/pdf";<br />
<br />
Source File: D:\TerritoryServer\Workspace\WebApp\rtest.aspx.cs Line: 99 <br />
<br />
Stack Trace: <br />
<br />
<br />
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]<br />
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0<br />
System.Security.CodeAccessPermission.Demand() +54<br />
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) +2103<br />
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +138<br />
System.IO.FileStream..ctor(String path, FileMode mode) +91<br />
sharpPDF.pdfDocument.createPDF(String outputFile) +82<br />
TerritoryServer.rtest.Page_Load(Object sender, EventArgs e) in D:\TerritoryServer\Workspace\WebApp\rtest.aspx.cs:99<br />
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25<br />
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42<br />
System.Web.UI.Control.OnLoad(EventArgs e) +132<br />
TerritoryServer.SecurePage.OnLoad(EventArgs e) in D:\TerritoryServer\Workspace\WebApp\clsSecurePage.cs:92<br />
System.Web.UI.Control.LoadRecursive() +66<br />
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11045655<br />
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11045194<br />
System.Web.UI.Page.ProcessRequest() +91<br />
System.Web.UI.Page.ProcessRequest(HttpContext context) +240<br />
ASP.rtest_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\de52e180\1e8e29d2\App_Web_poyidmvv.3.cs:0<br />
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599<br />
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171
|
|
|
|
|
David Hovey wrote: IIS_USRS had modify access already.
ASP.NET has it's own user-account, called ASP.NET[^]. Does that one have the appropriate rights?
I are Troll
|
|
|
|
|
Just tried that. Didn't notice that user account, but it doesn't work. Still receive exception.
|
|
|
|
|
My apologies, simply assumed that the account lacked read/write rights. You could try changing the trust level[^]
I are Troll
|
|
|
|
|
The error says "please contact your system administrator or change the application's trust level in the configuration file"
Did you do that?
|
|
|
|
|
Yes. I tried that with the below excerpt from my web.config file...The articles on this subject were very confusing, so I was hoping someone could shed light on if this is the proper direction for fix.
Regarding the below config file excerpt there were some articles that had a blank "originalurl" attribute. I tried that as well, and till same exception.
Could it be a trust level associated with the specific library?
<system.web>
<trust level="Full" originUrl="" />
|
|
|
|
|
Hi
I am showing some data from the database in the repeater like this.
<ItemTemplate>
<asp:Label ID = "lbl_CourseName" runat="server" Text='<%# Eval("Name") %>'/>
<asp:Label ID = "lbl_SectionID" runat="server" Text='<%# Eval("ID") %>' Visible="false"/>
</ItemTemplate>
So now what i want is when i click the Name, it should go to the "admin.ascx" page along with the corresponding ID. Any ideas ??
suchita
|
|
|
|
|
Like this[^] one? There's a helpfull list of howto's on the bottom, just above the example-usage of the LinkButton
I are Troll
|
|
|
|
|
thanks. I got it done already.
suchita
|
|
|
|
|
Hi,
I have problem that session start is getting fired each time I click on a page. But on other machine it is gets fired only once when session is started. I have the same code on both machine.
here is my code
string strOut = @"<SCRIPT language='JavaScript'>try{var tparent;if(parent.EnableClock == null){if(parent.parent.EnableClock == null){tparent = parent.parent.parent;}else{tparent = parent.parent;}}else{tparent = parent;} tparent.resetClock();tparent.EnableClock = true;tparent.startClock(" + Session.Timeout.ToString() + ");}catch(err){}</SCRIPT>";
Please Help,
Raghvendra Panda
modified on Wednesday, November 17, 2010 10:52 PM
|
|
|
|
|
suppose i have many update panel in my web page and based on few condition update panel is refresh from javascript at the time of page load.
is it possible to know which update panel causes partial post back from server side code. please help.
thanks
tbhattacharjee
|
|
|
|
|
hi guys
i create a mobile website but this is more wider a mobile page 240*320
and now i want to create a standard mobile resoulation
thanks a lot
|
|
|
|
|
There is no such thing as a "standard" mobile screen size. See here[^] for alist of common ones...
|
|
|
|
|
yup, Good Link.
|
|
|
|
|
Hi Experts,
In my applicaition User will be receiving mail through the applicaiton to Outlook and Lotus Notes. Now the problem is the applications sents the mail with the formatted text to the plain mail or to the Lotus Notes.
Now my requirement is if it is sending to the Outlook then it must be a HTML and if it is sending to the Lotus Notes then it must be a plain text. Any idea is much appreciated.
|
|
|
|
|
And what if the Outlook user has set it to read email in plain text format? You cannot control how users will read their email, nor even determine what method they use to do so. You need to send your emails in multi-part form - an HTML part and a plain text part - and let the email client determine which to use. See here[^] for guidance.
|
|
|
|
|
Thanks for you help!
I have used the link which is provided by you and sent a mail to both Outlook and Lotus Notes, both are same mail with no chages.
//if Lotus Notes
AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content, viewable by those clients that don't support html", null, "text/plain");
//if Outlook
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("<b>this is bold text, and viewable by those mail clients that support html</b>", null, "text/html");
This is not happening. I am getting only the HTML message on both the cases
|
|
|
|
|
I am not sure exactly what you are doing, but you need to send both "views" (HTML and plain text) as part of the same email - if you have done that and you are seeing the HTML view in Lotus Notes then I can only assume that is because that instance of Lotus Notes is set up to read HTML emails. You cannot force it to read the plain text view in your code.
|
|
|
|
|
I have a requirement in which i have to import an xml file of 180mb into the database. i tried to read the file using stringbuilder,session....but nothing worked .every time i tried to read the file ..i got an error of out of memory exception..
Please Help,
Raghvendra Panda
|
|
|
|
|
raghvendrapanda wrote: every time i tried to read the file ..i got an error of out of memory exception..
Shouldn't happen with a XmlReader[^]. Fetch a record, process it, and onto the next.
I are Troll
|
|
|
|
|
When I read your question I have to think of something I encountered.
My problem had to do with a limitation of Datasets. When the data exceeds about 100mb an 'out of memory' exception is thrown.
So if you use a Dataset to read/write the data, then the answer is probably to do this without using a dataset.
|
|
|
|