|
pls give any sample code.
I think using textbox.attributes will help for this(i don't know exactly)
thanks
paul
-- modified at 4:32 Tuesday 18th April, 2006
|
|
|
|
|
You can just put this line into your code behind (my asp textbox was just the default "TextBox1":
this.TextBox1.Attributes.Add("onkeyup","this.value = this.value.toUpperCase();");
|
|
|
|
|
hi,
I want to refresh a page after every 5 minutes automatically. The thing is that i donot want to refresh the whole page, i want to refresh only the gridview on the page (not the other controls like dropdownlist, text box, etc.)
I need to use-Light weight postback only not any other techniques like AJAx etc
if anyone have a code for this in ASp.net 2.0 (c#), please send it to me. i willl be highly greatful to u.
thanx
sandeep
|
|
|
|
|
i want to traverse through a treeview web control and fetch the ID's of all checked nodes.
that is, all those nodes whose checkboxes are checked in a treeview.i want to get their Id's.
i've used the following code :
''' For getting selected contact id's from the Group Tree
Function GetContacts() As ArrayList
Dim mnode As Microsoft.Web.UI.WebControls.TreeNode
Dim contacts As New ArrayList
Viewstate("ContactCounter") = 0
For Each mnode In TV_MasterContactList.Nodes
GetSelectedContactID(mnode.GetNodeIndex, contacts)
Next
Return contacts
End Function
Sub GetSelectedContactID(ByVal Tnode As String, ByRef Contacts As ArrayList)
Dim nnode As Microsoft.Web.UI.WebControls.TreeNode
If TV_MasterContactList.GetNodeFromIndex(Tnode).Type = "Contact" And TV_MasterContactList.GetNodeFromIndex(Tnode).Checked = True Then
Contacts.Add(TV_MasterContactList.GetNodeFromIndex(Tnode).ID)
End If
For Each nnode In TV_MasterContactList.GetNodeFromIndex(Tnode).Nodes
GetSelectedContactID(nnode.GetNodeIndex(), Contacts)
Next
End Sub
but its not giving the correct result
regards,
Kapil
|
|
|
|
|
So what does it give you? Do you assign the ID value which you expect to receive to the ID property of the TreeNode?
|
|
|
|
|
when i check some checkboxes and on button click call these functions to retrieve the checked checkboxes Id.
it shows even the checked checkboxes as unchecked and thus doesnt returns any Id's
|
|
|
|
|
You might want to debug your application and try to step through your sample code line by line. Also, i'm curious that why you don't just use the TreeNode instance from the Nodes collection instead of using the GetNodeFromIndex method. Anyway, below is a quick example for this:
private ArrayList GetContacts()
ArrayList Contacts = new ArrayList();
foreach(TreeNode node in TV_MasterContactList.Nodes)
{
GetSelectedContactID(node, Contacts);
}
return Contacts;
}
private void GetSelectedContactID(TreeNode node, ArrayList Contacts)
{
if(node.Checked)
Contacts.Add(node.ID);
foreach(TreeNode child in node.Nodes)
{
GetSelectedContactID(child, Contacts);
}
}
|
|
|
|
|
Usually to change a controls Property using script I just use ID.Property = "What I want"
But BoundField doesn't have an ID so now what?
|
|
|
|
|
You can access the field using the Columns collection of the GridView or the Fields collection of the DetailsView, that depends on which control you use.
|
|
|
|
|
Hi I have a problem with binding parameters to an update command for an asp:SqlDataSource. The problem is when I am trying to bind a ASP:CheckBox field.
I have this definition
<asp:FormView ID="HomeListingForm"
runat="server"
DataSourceID="SqlHomeListing"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None"
BorderWidth="1px" CellPadding="3" CellSpacing="2" GridLines="Both"
DefaultMode="Edit"
>
<EditItemTemplate>
<table>
…………….
<tr>
<td >
<asp:CheckBox ID="ckMealsAvailable" Text="Meals Available" Checked ='<%# Convert.ToBoolean(Eval("MealsAvailable")) %>' runat="server" />
</td>
<td >
<asp:CheckBox ID="ckPrivateLivingArea" Text="Private Living Area" Checked ='<%# Convert.ToBoolean(Eval("PrivateLivingArea")) %>' runat="server" />
</td>
</tr>
</table>
---------
</asp:FormView>
<asp:SqlDataSource ID="SqlHomeListing" runat="server"
UpdateCommand ="UPDATE HomeListing SET AddressLine1 = @AddressLine1, AddressLine2 = @AddressLine2, City = @City, PostalCode=@PostalCode, ProvinceId = @ProvinceId, PrivateLivingArea = @private_living_area WHERE ListingId = @ListingId"
ConnectionString ="<%$ …….. %>" >
<UpdateParameters>
<asp:FormParameter Name="AddressLine1" Type="string" FormField="AddressLine1" DefaultValue =""/>
<asp:FormParameter Name="AddressLine2" Type="string" FormField="AddressLine2" DefaultValue = "" />
<asp:FormParameter Name="City" Type="string" FormField="City" DefaultValue =""/>
<asp:FormParameter Name="PostalCode" Type="String" FormField ="PostalCode" DefaultValue =""/>
<asp:FormParameter Name="ProvinceId" Type="Int32" FormField ="Province" DefaultValue ="0"/>
<asp:FormParameter Name="private_living_area" FormField ="ckPrivateLivingArea" Type="Int16" />
<asp:SessionParameter DefaultValue = "0" Name="ListingId" Type="String" SessionField="ListingId" />
</UpdateParameters>
</asp:SqlDataSource>
I am getting this error; Cannot insert the value NULL into column 'PrivateLivingArea', table 'RentalProperty.dbo.HomeListing'; column does not allow nulls. UPDATE fails.
The statement has been terminated.
I know what it means but I can not figure out how to bind this checkbox field to the query parameters
|
|
|
|
|
Hi there,
The Eval method supports one-way (read-only) binding, here there are two options:
+ You can use the Bind method which supports two-way databinding instead of the Eval , you can read more about this in MSDN[^].
+ You can create a handler for the Updating event of the SqlDataSource control, in the method you can query the value of the check box and pass it to the input paramaters of the command.
|
|
|
|
|
Hi Everyone
I have my application in ASP.net and C#. I want to print datagrids on one of the ASP.net pages as a well formatted report. Could anyone please guide me how to go about this?
Thanks a lot in advance
Dipty
|
|
|
|
|
you have two options either put the grid which you want to print on a different page and on click of print open that page as a pop up and print view and on that page write a javascript function for printing it.
Or you can put grid in a div on same page and call print in javascript on same page.
|
|
|
|
|
Hello,
We trying to build the complete Member ship and Role management system in our website and build this functionality into our website for the Admin role rather using the ASP.NET Configuration thats comes default with VS 2005.
In Visual Studio 2005 for any website we can create and manage Users and Roles through the ASP.NET Configuration tool under the "Security" tab. How do I bring the same functionality of the entire "Security" into our website? I.e in other words creating a web page with the same functionality that the "Security" tab has.
Could some one help me to direct me where and how do I start building an Admin page to have all the functionalities like Creating Users, Mangeing Users, Creating Roles and Mnaging Roles, and defining access Rules etc..
Is there an article to go through to understand it?
thanks in advance,
-L
|
|
|
|
|
It's odd that Microsoft didn't include controls for membership management, or a (supported) means for using the ASP.NET management tool for production sites. It may be that's coming along later.
For the time being at least, you can build your own using the methods exposed by the Membership class[^].
Peter Kellner has a good article on this on MSDN (and his own site):
Microsoft ASP.NET 2.0 Member/Role Management with IIS[^] that you might want to check out.
|
|
|
|
|
Hi,
I have developed an web application using Visual web developer 2005 express edition. The application is working fine in development enviornment but in production which is the IIS 5.0 web server in windows 2000 Prtofessional operating I am not able to access the site.
I am using MS SQL Server 2000 as database.
can any one help me out to solve the problem.
Thanks & regards,
Praveen Goutia
|
|
|
|
|
Praveen02101980 wrote: I have developed an web application using Visual web developer 2005 express edition. The application is working fine in development enviornment but in production which is the IIS 5.0 web server in windows 2000 Prtofessional operating I am not able to access the site.
Do you have .NET 2.0 installed on the production server? Is the Web site on the production server set to use .NET 2.0 instead of 1.x?
Jon Sagara
Look at him. He runs like a Welshman. Doesn't he run like a Welshman? Doesn't he? I think he runs like a Welshman.
My Site | My Blog | My Articles
|
|
|
|
|
Hi,
I have installed .NET 2.0 on the production server and also configured to use ASP.NET 2.0.
The First page of the application is opening but all application is not able to access MS SQL Server in production environment.
|
|
|
|
|
Have you checked that the connection string that you are using has permissions to connect the database in the production server ?
Are you using Windows Integrated Security ?
/// -----------------------
Braulio Díez
http://www.bdiez.com
/// -----------------------
|
|
|
|
|
i want to start learning CrystalReport in asp.net(C#) but i dont know how should i start???????
can any body help me?????
can u tell me a refrance???????
|
|
|
|
|
Google for "crystal reports tutorial" perhaps?
Here's the Tutorials and Sample Code[^] listing for Crystal Reports/Visual Studio 2005 on MSDN.
|
|
|
|
|
in vs2005, how do you create page events for c#?
i used to use the dropdown list of page events from the GUI of vs2003
|
|
|
|
|
There is a list in the help section.
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref13/html/T_System_Web_UI_Page_Members.htm
I haven't figured out how to add them without typing them out either. It was easier in VS 2003. Maybe we are missing something.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi there,
Because the changes in ASP.NET 2.0 and the web pages now support auto event wire-up, so you can add the handler for an event of the Page instance by declaring the method in the naming format Page_event[^], for example Page_Load , Page_LoadComplete ...In Vs 2005, you can still add the event handlers using the Properties Window, however i don't think this is the official way to do this, but it's worth a try:
+ Open the web page .aspx in the design view, right click and choose View Component Designer. You can also choose this from the menu View|Component Designer.
+ Select the Properties Window in the left pane, select the code-behind class in the dropdownlist, then choose the event icon.
+ You now can add the event handler for a specific event of the class, VS 2005 will automatically add the code to wire up the event handler in the InitializeComponent method. And you need to manage to add the call to the InitializeComponent method since the VS 2005 does not do that for you, you can add to the overriden OnInit or OnPreInit .... method:
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
|
|
|
|
|
Hello every one.
I'm using Response.Write in the Page_Load event to write a JavaScript and open a new windows if querystirng id parameter was providet.
But when i do this my Theme/css looks wiered, colors are right but tekst size are wierd and to large, on top of each others and so on...
Start of html coden when JavaScript was written and site looks crapy:
<script language="JavaScript"> window.open("survey.aspx?id=20&company=luc", "Survey", "toolbar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=520, height=450");</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
-------------------
and without and site looks great:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
--------------------
Any idears why, or is the a page event i can use to response.write the code after all other html stuff is written insted of the top of the document?
Thx in Advance
|
|
|
|