Forms Data Controls :: Pass A Texbox.text To A Public Shared Function?
Jan 12, 2010
I have a gridview that is dynamically created and have finished all but one problem - I need for my code that is within a Public Shared Function to access a textbox string - In the below I need myinput to return the string so that my query's can use the variable - the below shows: Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class.
If I remove the "Shared" the error goes away however it crashes other parts. (if I hard code the text then all works as expected)
[Code]....
View 3 Replies
Similar Messages:
Jan 12, 2010
I am using the following code for slide show of AjaxToolkit. It works. But I wanna get the label1.text as picture name But I cannot do it in public shared function ! How can I do that !
[Code]....
View 6 Replies
Jan 5, 2010
let me know what does these access modifiers means.private shared vs public shared vs protected shared
View 5 Replies
Feb 10, 2011
I can access a module from code behind but not from the aspx page in inline VB code <% ... %>.
I know its got to be something simple but I can't seem to find the answer anywhere.
View 1 Replies
Feb 17, 2011
In my example below I am trying to Bind 2 different size GoogleAds to the 2 first rows in the GridView. One Ad on each row. The ads that are inside.......
(i2 == 0) and(i2 == 1).
I need to use <%if (Counts < 2) %> in HTML to restrict it to just 2 Rows, so this variable needs to be passed correctly also. As it is now, Counts is not passed correctly so <%if (Counts < 5) %> needs to be set in order to see any ads at all. I beleive this is because Page.DataBind() is binding the last ad in memory from the loop.
So when running this code, the same ad (i2== 2) is set to 3 rows in the GridView. This is my problem!
[Code]....
View 2 Replies
Jan 21, 2010
I have the following code for ajaxtoolkit slideshowextender's service method. I want to get the label1.text value to make the pictures diynamic. I hope you know what I mean. Bu I cannot ! here is my vb code;
[Code]....
I tired the below one but didn't work;
[Code]....
View 12 Replies
Nov 12, 2010
I want to call a non shared function in a shared function in which i am having a textbox control instance. Its giving no error but when i call this shared function from client callback it gives me no response
Any Idea except removing shared from the function.
Here is my code :
<WebMethod()> _
Public Shared Function myF() As String
Dim pg As New _Default
Return "{'Hello':'" & pg.setText & "'}"
End Function
Public Function setText() As String
Dim pg As New _Default
pg.TextBox1.Text = "This is a test"
Return pg.TextBox1.Text
End Function
View 2 Replies
Aug 14, 2010
I have made public readonly shared properties in my class.
I want to acces a property's value in .aspx page. As i think that is possible through scriptlet like this
<%= ClassName.Propertyname %>
But its not working .Where i am wrong ?
View 5 Replies
Oct 4, 2010
I have the following code in a class in which I call from different pages, I wanted to know where this info is being stored at as I can see it from different pages.
[Code]....
Also, is this saved on the browser session? IIS? will whatever being set from 1 user be affected by every other user on the site?
View 5 Replies
Dec 6, 2010
How do I can I pass each item in a drop down to a function?
[Code]....
View 3 Replies
Jan 8, 2010
We have an application that has quite an extensive APP_Code directory (about 150 functions). The functions are split across multiple files and then classes and namespaces.
On numerous pages we have to create numerous instances of the classes to be able to access the functionality, which can get very repetitive and means we're repeating code on every page declaring the instance etc.
As far as I can tell, a way to navigate this issue, is to make the functions Public Shared (as opposed to just Public functions).
View 5 Replies
Nov 11, 2010
For reasons I would rather not discuss, I need to create a custom authentication system for my app. I was just reviewing the system and am having some doubts if my solution is thread safe. My goal was to create a solution that would allow my app to authenticate a user one time and that users authentication info would be shared by all master pages, pages, classes, user controls, etc that are used. (But not share the same info between users) Here is my setup: PageHttpModule.cs - this is added to the web.config as a httpModule.
public class PageHttpModule : IHttpModule
{
public void Init(HttpApplication app)
{
app.AuthenticateRequest += new EventHandler(OnAuthenticateRequest);
}
public void OnAuthenticateRequest(Object s, EventArgs e)
{
CurrentUser.Initialize();
}
public void Dispose() { }
}
CurrentUser.cs
public static class CurrentUser
{
public static bool IsAuthenticated { get; private set; }
public static string Email {get; set;}
public static string RealName {get; set;
public static string UserId {get; set;}
public static void Initialize()
{
CurrentUser.AuthenticateUser();
}
Note: this is a scaled down version of my authentication code.
public static void AuthenticateUser()
{
UserAuthentication user = new UserAuthentication();
user.AuthenticateUser();
if (user.IsAuthenticated)
{
CurrentUser.IsAuthenticated = true;
CurrentUser.UserId = user.UserId;
CurrentUser.Email = user.Email;
CurrentUser.RealName = user.RealName;
}
}
}
UserAuthentication.cs
public class UserAuthentication
{
public string Email { get; set; }
public string RealName { get; set; }
public string UserId { get; set; }
public bool IsAuthenticated { get; private set; }
public UserAuthentication()
{
IsAuthenticated = false;
Email = String.Empty;
RealName = String.Empty;
UserId = String.Empty;
}
public void AuthenticateUser()
{
//do some logic here.. if the user is ok then
IsAuthenticated = true
Email = address from db
UserId = userid from db;
Realname = name from db;
}
}
I have tested between 3 different browsers and it seems to work fine, but I am still learning and don't want to make a huge mistake. If my logic is totally wrong, then how should I do it so I dont have to put user lookups on every page directly?
View 4 Replies
Jun 1, 2010
I have a form with 4 multiline textboxes on it, however when user hits print button it only prints out what is on the screen and not entire contents of the textboxes. I have this javascript I created but it does not seem to be working..still will not print out entire content of texboes. On my Ascx page I am using the <div id="printdiv"> .
[Code]...
View 1 Replies
Mar 23, 2010
Basically, I have a gridview that is opened in a new window from the parent window. It has a bunch of records with a view button to view the details of each record (which stays in the same newly opened window). I have a calendar in the parent window that accepts a Date querystring parameter to set the current date on the calendar at page load. I'm just trying to refresh the calendar in the parent window to match the date of the label in the newly opened window. All the code below is in the newly opened window. The .Net code-behind below refers to when that view button is clicked and everything is populated. At the end, I call the js to refresh the parent window and pass the value of the LabelScheduleDate as the querystring parameter. Now the label comes through as '03/25/2010' in the code-behind, but when I pass it to the js, it comes through as '0.00005970149253731343' in the end querystring. I'm not really sure what is making the value change, and I want to pass it as just text. Do I need to pass it as a string object? I tried but I don't think I was doing it right.
JavaScript Function
function RefreshParent(inputDate) {
window.opener.location = window.opener.location + "?Date=" + inputDate;
}
.NET Code-Behind
Protected Sub RadGridOnlineRequests_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridOnlineRequests.ItemCommand
If e.CommandName = "ViewOnlineRequest" Then
' populates LabelScheduleDate among other controls values
ScriptManager.RegisterStartupScript( _
Me, Me.GetType(), "clientScript", "RefreshParent(" & LabelScheduleDate.Text & ");", True)
End If
End Sub
View 1 Replies
Sep 4, 2010
I have one common Data Access function which returns output as datasetwhich is as below
Public
Shared
Function ExecuteDataSet(ByVal sql
[code]...
View 5 Replies
Jan 5, 2010
i followed this link [URL] and i get selected value from dropdownlist using jquery
i created 3 partial views .
i need depend's on dropdownvalue redirect to partial page , so how can i implement in jquery with conditions?? or how can i implement in this function Public Function FetchData(ByVal dropdownValue As String) As ActionResult??
View 1 Replies
Jun 26, 2010
I am working with a repeater control for a reporting purpose.
I have 2 repeaters one inside another , i hvae to bind the second repeater with the help of function which is having two parameters to pass in it
<asp:Repeater
ID="Rptgsaaccount"
runat ="server"
DataSource ='<%#bindcourse(Eval("Session_Id"),2nd parameter)%>'>
the first parameter is i am easily getting from outer repeater, but the second parameter value is exist on the server side and in a session variable
i have to pass this server side session variable value in above mentioned function as a second parameter .
View 2 Replies
Nov 22, 2010
Create value for Gridview2
New Data.SqlClient.SqlConnection("ConnectionString")
Dim MSQL As New Data.SqlClient.SqlDataAdapter("SELECT Code, [Description] FROM [Dimension] where [Code] = '" & selrow.Cells(1).Text & "' ORDER BY [Line] ASC ", conLathv)
Dim ds As New Data.DataSet()
MSQL.Fill(ds)
GridView2.DataSource = ds
GridView2.DataBind()
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns ="False">
<Columns >
<asp:TemplateField HeaderText ="Code">
<ItemTemplate >
<asp:TextBox runat="server" text= '<%# Eval("Code") %>' ID=TextBox6"
></asp:TextBox>
</ItemTemplate>
</asp:TemplateField >
<asp:TemplateField HeaderText ="Description">
<ItemTemplate >
<asp:TextBox runat="server" text= '<%# Eval("Description") %>' ID="TextBox5"
></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns >
</asp:GridView >
How can i get specific data from textbox6 or texbox5. Gridview2 have 2 cels and 10 rows.
View 3 Replies
Jun 15, 2010
I am using a linkbutton iside a gridview.... i need to get the text of the link button in another function. how can get that ... i tried find control .. but its not working.... I created the link button from other function which executes just b4 this function...
View 3 Replies
Jan 2, 2011
I am new here, I was thinking about using a text box to function as a search box. For example, I key in the ID, the value will be searched in the SQL database and return other values in the same row. I was thinking of combining this with GRIDVIEW.
View 2 Replies
May 7, 2015
How do I pass Hidden Variable to javacript function on GridView hyperlink click.Below is the code used
<asp:GridView ID="gridMicroscopicCode" runat="server" ...
<ItemTemplate>
<table id="Table2" cellpadding="0" style="border-width: 0px; width: 100%;" class="tableBorder" runat="server">
<tr class="botborder1">
<td style="width: 25%;">
<input id="Hidden1" runat="server" value='<%# Bind("preferenceid")%>' type="hidden" />
<asp:HyperLink ID="hypMicroscopicPopUpEdit" runat="server"
Target="_self" NavigateUrl="javascript: EncryptDataFunc('VAAddEditMicroscopic.aspx?editoption=yes&queryprefid=' + <%# Hidden1.value %>);">
</asp:HyperLink>
View 1 Replies
Oct 20, 2010
i want know, How we can select and pass a grid column value to a text box for other work
View 3 Replies
Apr 6, 2010
I m using textbox inside the gridview with 5 rows. when user click on submit button it should be display alert message if all 5 textbox field is empty "you cant submit message".If user any one of the textbox value he/she submit the data
View 5 Replies
Apr 8, 2010
i have gridview resulted from sql query as below:
customer_id
items
123
pen
123
paper
456
pen
456
paper
678
pen
then i pivot the gridview by using the datatable.. i call the sql query to the datatable, pivot it using pivoted function and the datatable then become the datasource bind to the gridview..the result of pivoted datatable in gridview as below:
customer_id
pen
paper
123
(empty)
(empty)
456
(empty)
(empty)
678
(empty)
(empty)
my question is..how can i replace the empty column with textbox to be display within the gridview??? i need to use textbox so that user may enter the value of the item within the textbox.. i try using the itemtemplate for gridview but it's doesn't work and the itemtemplate create new column with textbox beside the paper column.. how to input textbox within the datatable in my case??
View 1 Replies
Aug 25, 2010
On inserting record, I want to check that for example if a user enters a telephone number for any record is already in the database then it should validate that the number already exists in table and you cannot enter a duplicate value.
Then if user will provide some other telephone number then he allows to insert record.
For insertion of record I used ObjectdataSource.
User will enter telephone number in a simple textbox.
I may want to inform that I am working in asp.net2.0 and also not allowed to use any third party control or ajaxtoolkit.
View 11 Replies