|
I successfully created a child gridview with a datalist as my parent. It works well but i decided to put a total on the child gridview's footer. I use databoud fields instead of templatefield fo i can set the nulltext to "0". whn I click an item (item A) to my datalist(parent) it will show the gridview with total sum at the footer. The problem is that, when i click another item on the datalist (sample item B) the total sum at the childgrid of item B is correct but the total sum of the other childgridview (like item A) becomes "0". I used the RowDataBound event to get & compute the total using global variable. I used RowCreated to set the total at the footer.
Any help and sample codes would be appreciated. Thanks in advance.
|
|
|
|
|
hi friend's
i want to use parallel programming method for write my project.but i don't know how can i do it.
and i have one question about it:
is parallel programming similar to threading or not.
oh my god im confusing... please help me.
thank you
msma
|
|
|
|
|
|
Is it not possible to have the following in ASP.NET 2.0:
<br />
(something)<br />
<asp:LoginView><br />
<AnonymousTemplate><br />
<asp:Login ... /><br />
</AnonymousTemplate><br />
<LoggedInTemplate><br />
(something)<br />
</LoggedInTemplate><br />
</asp:LoginView><br />
...without having a separate page to login?
The idea is that I want to display a bunch of controls (that everybody can see), and then a section containing a login control (prompting for username/password) only if the user isn't currently logged in. If the user is logged in, then I want to display another set of controls (specified here within the LoggedInTemplate tag).
In other words, I don't want a separate page dedicated solely to the login process, but rather, have the login controls displayed "inline" (for lack of a better word) if the user isn't authenticated.
It seems that every form authentication sample I've come across so far implies that you have to have a separate login page that you'll get redirected to in order to perform the login process.
-- modified at 15:39 Thursday 30th August, 2007
|
|
|
|
|
Oh, the sheer stupidity.
I've just spent a day and a half on this.
Now I get an idea as I'm typing my message here, finish off my message, try out the idea, and sure enough, I've just found the solution.
The problem: my rules were setup so anonymous users were denied access to my page...and thus got redirected to login.aspx (which I haven't written) instead of getting prompted right there on that same page...
Lemme hear a big resounding DUH!
|
|
|
|
|
Okay, so here's a real question (jeez, I hate seeing 3 messages in a row in a thread all originating from myself...before anybody else has had a chance to write anything...)
I already had this page written and working before I tried adding the login control. Now I've moved the controls (that I only want authenticated users to see) within the <LoggedInTemplate> tag. Hit F5...and all references (in the code-behind) to those controls result in "The name 'xxx' does not exist in the current context".
For example, I have a listbox (lstCategories) within the <LoggedInTemplate> tag. It'll complain that this doesn't exist (anymore--it was working fine until I added the login stuff).
I've tried variations such as LoginView1.lstCategories, LoginView1.LoggedInTemplate.lstCategories, etc, but IntelliSense tells me none of that is valid.
It looks so far like my only option is to move everything I put in <LoggedInTemplate> outside of it, put that inside an <asp:Panel> instead, and set its visible state depending on whether HttpContext.Current.User.Identity.IsAuthenticated returns true or not.
Is this the best approach? The .aspx would be *so* much cleaner if I could leave those controls within <LoggedInTemplate>...not to mention having to manage visibility based on authentication state...
|
|
|
|
|
Hi guys i need to finish my project and i have no clue how do solve this issuse please help me i would realllly really appreciate. On my 2nd aspx page i want to get the myID value i am not getting anything.
<asp:linkbutton id="myLnkBtn" runat="server"
="" postbackurl="~/index.aspx?myId=<%=usrID%>">
|
|
|
|
|
it is an asp:LinkButton that has a property of PostabckURL
I am still unable to solve could some body please tell me
|
|
|
|
|
hello...
if it is LinkButton then use
Response.Redirect()/Server.Transfer() .... it is more ideal....
Try it........
|
|
|
|
|
follow steps
Step1 : Make public property of UsrId in first page
Step2 : Use PostBackUrl="~/index.aspx" Instead of PostBackUrl="~/index.aspx?myId=<%=usrID%>"
Step3 : Use PreviousPage Directory in Source html of second page
<%@ PreviousPageType VirtualPath="FisrtPageName.aspx" %>
Step4 : get UserId int UsrId=this.PreviousPage.PropertyName
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Thank you so much you have just solved one problem. Now the thing that confusing me is that for each linkbutton i want to associate a value.
Lets say there are 5 link button so how could I assigned a unique value with each linkbutton. That i need to do my calucation.
Any help would be appreciated
|
|
|
|
|
You can identify using LinkButton lnk = (LinkButton)sender;
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Hi All,
I have another question.
I have a table, and I want the user to be able to dynamically add multiple rows to this table. Then during the final submit, I want to get information from these dynamic rows.
However the table isn't passed to the code behind by either Request.Form or Request.Params. Do you know where I would get access to the table in the code behind?
- Munty
|
|
|
|
|
Muntyness wrote: Do you know where I would get access to the table in the code behind?
If your table is a server control you may get access from the code behind. Make your table as server control and access with it's id
|
|
|
|
|
I need a free asp.net 2.0 with support for sql2005 and AJAX host to test my asp.net application.
t.aransiola
|
|
|
|
|
IIS on your PC? How about running it from Visual Studio.NET 2005?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
This checkbox on my login control has been working but now, the if i check teh Remember Me check box, teh login control does not remember my last login user name. see my code below
I am using Internet explorer 6.
Mozilla Firefox display the first 5 characters of my userID
Imports FriendsTier
Partial Class Login
Inherits System.Web.UI.Page
Dim oTier As FriendsTier = New FriendsTier
Dim strUserID As String
Dim strPassword As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'If IsPostBack Then 'on for the first time
If Request.Cookies("loginuserid") IsNot Nothing Then
Dim strUserID As String = Request.Cookies("loginuserid")("user")
If strUserID IsNot Nothing Then
myLogin.UserName = strUserID.ToString
End If
End If
End Sub
Protected Sub myLogin_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles myLogin.Authenticate
strUserID = myLogin.UserName.Trim
strPassword = myLogin.Password.Trim
If Session("loginuserid") IsNot Nothing Then
Session.Remove("loginuserid")
End If
If oTier.ValidMember(strUserID, strPassword) = True Then
'create the session vars
Session("loginuserid") = strUserID
'grants the access, goto Destination url page
e.Authenticated = True
Else
'confirm that you are out
e.Authenticated = False
End If
End Sub
Protected Sub myLogin_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles myLogin.LoggedIn
'This event is fired when the Login button is pressed
Dim chkRemember As CheckBox
'Since At the Conversion to html, the checkbox is named as login.ID along with the "$RememberMe".
'Since no such control (RememberMe) exist, you are getting error.
'always check whether the control exists
'
If (Not Me.FindControl(myLogin.ID & "$RememberMe") Is Nothing) Then
chkRemember = CType(Me.FindControl(myLogin.ID & "$RememberMe"), CheckBox)
Else
chkRemember = New CheckBox()
End If
If chkRemember.Checked = True Then
'cookies are sent to the user's pc using httpresponse
Dim oCookie As HttpCookie = New HttpCookie("loginuserid")
'remove previous cookie
If Request.Cookies("loginuserid") IsNot Nothing Then
Response.Cookies.Remove("loginuserid")
End If
'Assign values to cookie's subkeys
oCookie("user") = myLogin.UserName 'oCookie.Values.Add("user", Login.UserName) '
oCookie.Expires = DateTime.Now.AddDays(15)
'Add the cookie to the Cookies collection
Response.Cookies.Add(oCookie)
End If
End Sub
End Class
t.aransiola
|
|
|
|
|
what is the best way to send an arbitrary file through webservices?
(I think transforming it to an array of bytes is not a good idea...)
|
|
|
|
|
I would say array of bytes is good enough, actually file is exactly that: array of bytes. You don't have to transform anything, just load your file from FileStream into byte array.
check this article, maybe it helps you:
http://www.codeproject.com/vb/net/wsfileserver.asp
Pilo
|
|
|
|
|
Thank you for the answer, when I said "transform" I meant "load" but when passing through the webservices an array of bytes will be transformed to some xml-data, something like this: (array)(byte)1(/byte)(byte)2(/byte)(/array)
This data contains a lot of unnecessary information (repeated "byte" nodes).
Are there any techinques to send the file in more compact format that needs less memory size?
|
|
|
|
|
I think WCF is the solution for you. WCF supports Large Message Transfer. If you want to use Http protocol, you need to use wsHttpBinding (design to supports SOAP 1.2 standard; amsx web service is SOAP 1.1 standard). To support Large Message Transfer, you can set messageEncoding to MTOM (MTOM stands for Message Transmission Optimization Mechanism). You also need to adjust the maxReceiveMessageSize and maxReceiveMessageSize of the binding because the default is not very large.
petersgyoung
|
|
|
|
|
But WCF is a part of .NET 3.0. Are there any methods to do this using .NET 2.0?
|
|
|
|
|
If you want to stick to older technology, you can try WSE (Web Service Enhancement). If I remember correctly, WSE is an add-in which makes SOAP with Attachments (SwA) and Direct Internet Message Encapsulation(DIME) possible on older framework, e.g. .Net 1.1. I, however, do not recommend you to learn phasing out technology. SwA and DIME are now replaced by MTOM.
petersgyoung
|
|
|
|
|
Ok, thank you, I'll think about this
|
|
|
|
|
Strictly speaking, you can't send a file through webservices, you can only send the data in the file.
If you can't assume anything about the content of the file, a byte array is the only way that you can represent the data in the file. You can then convert the bytes to anything you like, for example a Base64 string, but there is no way around the byte array.
---
single minded; short sighted; long gone;
|
|
|
|