|
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;
|
|
|
|
|
I understand that I can send only the data in the file. The question is how to represent this data for transfering through webservices? I want the memory size of my file data to be as small as it can be. For example, if I have an array of bytes, data that passes through webservices should look like this: (array)(byte)1(/byte)(byte)2(/byte)(/array). And it's not very good, because "byte" xml-nodes are repeated too often. And the string representation causes some problems with encodings.
|
|
|
|
|
You can turn it into a Base64 string using the Convert.ToBase64String method, and convert it back to a byte array using the Convert.FromBase64String .
The Base64 encoding stores 6 bits in each character, which gives you an overhead of only 33%.
---
single minded; short sighted; long gone;
|
|
|
|
|
But 2 bits will be lost, won't they? (I am not strong in encodings...)
|
|
|
|
|
steve_a_p wrote: But 2 bits will be lost, won't they?
Of course not, that would be pointless. All the bits are distributed across characters. Three bytes (3*8 bits) are stored in four characters (4*6 bits).
---
single minded; short sighted; long gone;
|
|
|
|
|
I don't know, may be there is some special stream for sending file data from client to server at once, isn't there?
-- modified at 5:09 Friday 31st August, 2007
|
|
|
|
|
I am currently implementing some search engine optimisation accross a large site. The site has a single master page that handles all of the pages. Obviously within each page I can set the pages title using
Master.Page.Title = "The title"
But when it comes to meta tags there are no available easy way's of tackling this, so i had planned to create some. As follows
<!-- BEGIN META TAGS --><br />
<meta id="MetaDescription" runat="server" name="Description" content="" /><br />
<!-- END META TAGS --><br />
As one tag
and then
Public Property MetaTagsDescription() As String<br />
Get<br />
Return MetaDescription.Attributes.Item("content")<br />
End Get<br />
Set(ByVal value As String)<br />
MetaDescription.Attributes.Add("content", value)<br />
End Set<br />
End Property
to create the get and set properties. My question is this. If I were to add another meta tag and create it's get and set properties how could I got about surrounding these two get and set section into a single meta tag property.
So I could do the following code in the page
Master.MetaTags.Description = "Hobo"<br />
Master.MetaTags.Title= "Hobo"
Any help on this one is much appreciated.
|
|
|
|
|
CongfigurationErrorsException
An error occurred creating the configuration section handler for dataConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (D:\WebSite2\web.config line 12)
Hi my code runs fine when I don't use MSEnterpriseLibarary 3.1 Configuration tool and simply adding the reference to the dlls, But the same when I want to do with MSEnterpriseLibarary 3.1 configuration tool I am getting the Above Exception.
As I am new to using the tool may I am missing something important....
Help needed ....
Thanks in advance
|
|
|
|
|
Did you have any previous versions installed? Sounds like a version conflict. Try removing all instances of EL and reinstalling.
only two letters away from being an asset
|
|
|
|
|
Thanks But Suggestion didn.t worked
|
|
|
|
|
Hello,
How to send the email to a list of users like Newsletter........in ASP.NET
Thnx
|
|
|
|