|
Sorry the usercontrol's source was not complete:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile = "~/UserControl/tabcontrol.ascx.cs" Inherits = "UserControl_tabcontrol" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:updatepanel id="ajaxDisplayContent" runat="server">
<contenttemplate>
<asp:panel id="pnlTabControl" runat="server" visible="false">
<asp:label id="lblMessage" runat="server" forecolor="white">
|
<asp:literal id="litDisplayCategory1" runat="server">
|
|
<asp:linkbutton id="lbContent1" style="text-decoration:none;" runat="server" commandname="Content1" commandargument="1" onclientclick="" onclick="lbContent_Click"> 1
|
<asp:linkbutton id="lbContent2" style="text-decoration:none;" runat="server" commandname="Content2" commandargument="2" onclientclick="" onclick="lbContent_Click"> 2
|
<asp:linkbutton id="lbContent3" style="text-decoration:none;" runat="server" commandname="Content3" commandargument="3" onclientclick="" onclick="lbContent_Click"> 3
|
|
|
|
|
|
|
|
|
Need help. I am trying to add a hyperlinkfield dynamically to a grid view , that works fine until i want to pass a parameter to the string, i get this error
BC30311: Value of type 'String' cannot be converted to '1-dimensional array of String'.
this is the code,
<br />
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
SqlDataSource1.SelectCommand = "SELECT * FROM [products]"<br />
GridView1.DataKeyNames = "pid"<br />
Dim lnk As HyperLinkField<br />
lnk = New HyperLinkField<br />
lnk.DataTextField = "pname"<br />
lnk.NavigateUrl = "home.aspx"<br />
lnk.DataNavigateUrlFields = "pid"<br />
<br />
End Sub<br />
<
<br />
asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" EnableViewState="false"><br />
<Columns><br />
<br />
</Columns><br />
</asp:GridView><br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:vpx_newConnectionString %>"<br />
></asp:SqlDataSource><br />
|
|
|
|
|
Dim x As String() = New String(0) {}
x(0) = "pid"
lnk.DataNavigateUrlFields = x(0)
I didn't get any requirements for the signature
|
|
|
|
|
thank you so much for taking the time to answer, but still not working, i can't believe, i put the code this way
Dim lnk As HyperLinkField<br />
lnk = New HyperLinkField<br />
lnk.DataTextField = "pname"<br />
lnk.NavigateUrl = "home.aspx"<br />
lnk.DataNavigateUrlFormatString = "~/home.aspx?pid={0}"<br />
Dim x As String() = New String(0) {}<br />
x(0) = "pid"<br />
lnk.DataNavigateUrlFields = x(0)<br />
and still, over the last line on x(0) still have the message that says
value of type 'string'cannot be converted to '1 dimensional array of string'
|
|
|
|
|
i mean if i coment this line
lnk.DataNavigateUrlFields = x(0)
it add that hyperlinkfield , but not passing the parameter.
|
|
|
|
|
lnk.DataNavigateUrlFields = x
BTW, set option strction on
set option explicit on
It will force you to write better code.
I didn't get any requirements for the signature
|
|
|
|
|
GridView1.DataKeyNames gets the array of string so GridView1.DataKeyNames="pid" is wrong.
lnk.DataNavigateUrlFields is also gets the array of string so
lnk.DataNavigateUrlFields = x(0) is wrong coz x(0) returns only string
try this
lnk.DataNavigateUrlFields=x
Best regard
Pathan
---------------------------------------------------
|
|
|
|
|
Great, Now works perfectly, Thank you so much to both of you guys.
I will follow your advice , once again thanks
|
|
|
|
|
Hello Developers
I need to count number of users signed in to their account area on current time. Furthermore I need to view information of all users currently onlin.
I think the main problem is handling the event when a user close its window.
Any idea..............!
|
|
|
|
|
Try Google
I didn't get any requirements for the signature
|
|
|
|
|
u can do it open add fiel into the Application and when user log in increase it value by one ,also when the user loged out decrease that varialble
1-when application start
Application.Add("UsersCount",0);
2-when User is logged in
Application["UsersCount"]=(int)Application["UsersCount"]+1;
3-when user logged out
Application["UsersCount"]=(int)Application["UsersCount"]-1;
regards
|
|
|
|
|
And if your user does not log out but simply closes the browser window you have to track the last request time and flush the user out if the last request was earlier than the session timeout.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
wEb GuRu... wrote: I need to count number of users signed in to their account area on current time. Furthermore I need to view information of all users currently onlin.
You can create an application variable that holds all data you need. When each session starts, Session_Start event will be fired on Global.asax . You need to increment your application variable count here. In session_end decrease this value. This is the easy approach. But there are some problems with this
1- Session_End is not reliable
2- It's will be fired only if you are using inproc mode.
I have done this by creating a HTTPModule . For session end, I used cache and set Session timeout for cache. You need to create a delegate for Cache end, this will be similar like your session_end, but reliable.
wEb GuRu... wrote: I think the main problem is handling the event when a user close its window.
This is a common issue. No events will be fired on server when user closes browser. You need to wait till the session/cache ends.
|
|
|
|
|
Hi,
I need your help in my project i am using asp.net ajax toolkit controls, in that calendar control, after selecting the date i want to close that popup calendar window.please anybody help me please...waiting for your reply...
thanks & regards
Alex.
|
|
|
|
|
R you displaying that CalendarExtendar control in same page or another popup window????
use self.close(); method
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
hai,
i am using default calendar method.while clicking the textbox calendar control will be displayed just below the textbox....i want to close or disapper that calendar after selecting the date.
the code i wrote is
<cc1:datepickertextbox id="txtLogStartDate" runat="server" onkeydown="return false;" cssclass="entrytext">
<cc2:calendarextender id="defaultCalendarExtender" runat="server" targetcontrolid="txtLogStartDate">
help me ..
alex.
|
|
|
|
|
Where is code?????????????
Best Regard
pathan
---------------------------------------------------
|
|
|
|
|
hai,
I couldn't able to paste the code here...
what i did was
one textbox is added and one CalendarExtender ....i want like after the selection of date that calendar should be invisible.....hope u understand my problem...
regards
alex.
|
|
|
|
|
After selecting date when u press TAB its automatically closed calendar.You have no need any code to close it manually.
see Example here CalendarExtendar
I couldn't able to paste the code here...
Check Ignore HTML tags in this message CheckBox here
Best regard
Pathan
---------------------------------------------------
|
|
|
|
|
<asp:textbox ID="Textbox1" runat="server"></asp:textbox>
<cc2:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="Textbox1" OnClientDateSelectionChanged='hideCalendar'>
</cc2:CalendarExtender>
i want to close the calendar after the selection of date....
|
|
|
|
|
See the exmaple here Calendar for "Calendar with an associated button:"
apply PopupButtonID="button" it will be closed calendar control
best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
hi,
I accept that, but the problem with that control is if we click the button the popup will come then if the user click again into the button the page will refresh that's actualy a fault...
can you help me to solve that with this method that's actually my need.
what i want is the same thing as you told but page will not be refreshed again if we click again into the button..hope you understand my problem...
regards
alex.
|
|
|
|
|
Ya I understand ur problem.
But y did u used Button? Use HtmlImage control Instead of Button
<img src="filepath.gif" id="img" runat="server" />
this control will not be refreshed ur page.
OR If u want to use Button control then just use OnClientClick="return false;"
Hope this will be solved ur problem
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Hello Everyone,
Can we use a text box like "Rich Text Box" .......
Actually i've to provide facility like bold,italic,underline and etc to the use at feedback form in ASP.NET(1.1) with c#
Suggest me some ways
Thnx
Your Friend
|
|
|
|
|
Get It Rich Text Editor
Best Regard
Pathan
---------------------------------------------------
|
|
|
|