|
Take Place Holder in page
Create object of control like as
-- TextBox txt1=new TextBox();<br />
---txt1.ID="txt1";
Add this control in placeHolder
<br />
-- PlaceHolder1.Controls.Add(txt1);
To use this control
use findcontrol method
--
string val=((TextBox)this.Page.FindControl("txt1")).Text;<br />
Best Regard
Khan
---------------------------------------------------
|
|
|
|
|
Hi,
I have used Class library using C# ASP.NET2005 and created a public-private key using Sn -k myfile.snk syntax.
I have signed in the key to the class library created and had builded it.
I have added the dll to the GAC using gacutil /i myclasslib.dll
The dll is successfully added to cache.
Now,
1.How to include the shared myclasslib.dll to my new asp.net c# application?
2.Does the myfile(strongname) created can be used for sharing more than one dlls?
3.If so then how can the stron name can uniquely identify the assembly?
4.Does the c# dll can be used in vb.net windows application?
Thanks,
zari
|
|
|
|
|
zareee wrote: 1.How to include the shared myclasslib.dll to my new asp.net c# application?
If your assembly is added to Global Assembly Cache, then you can add reference to it.
zareee wrote: 4.Does the c# dll can be used in vb.net windows application?
Yes you can use that. It will be in MSIL ( Microsoft Intermediate Language ) format. It doesn't care about C# or VB.NET.
|
|
|
|
|
In add reference i dont have the dll i created. But the dll is there in c:/winnt/assembly.
zari
|
|
|
|
|
Hi
I have got a datagrid which, has an asp:image tag embedded through the columns, i have it pulling in the image url from a database.
It does all this succesfully, but it jus won't render the images in the browser, it jus shows my alternative text.
Is there somthing i am not doing? do i have to write a method for rendering these, if so how would i go about it?
here is my code
any help would be great, cheers
Boyindie
<form id="form1" runat="server">
<div>
<asp:DataGrid runat=server ID=dgImage AllowPaging="True" AutoGenerateColumns="False" DataKeyField="imageId">
<Columns>
<asp:BoundColumn DataField=imageId HeaderText="Image ID" ></asp:BoundColumn>
<asp:TemplateColumn HeaderText=Products >
<ItemTemplate >
<asp:Image runat=server ID=imageHolder imageurl='<%#databinder.eval(container.dataitem,"imageAddress")%> ' Width=60 Height =80 BorderWidth =1 AlternateText='<%#databinder.eval(container.dataitem,"imageAddress")%> ' />
</ItemTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn HeaderText="View item" CommandName=getDetails ButtonType=PushButton Text=Select></asp:ButtonColumn>
</Columns>
</asp:DataGrid>
</form>
</body>
'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
'Open connection to DB
connection.Open()
'Create mySql command string for passing query or SPROC(Stored Procedure)
Dim cmdString As New MySqlCommand
'Set Command to equal mySql connection, so can pass SQL query
cmdString.Connection = connection
'Set command string to equal SPROC
cmdString.CommandText = "sp_image"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure
'Create dataAdaptor for passing data between .net and mySQL
Dim dataAdaptor As New MySqlDataAdapter
'Sets command object to datAdaptor
dataAdaptor.SelectCommand = cmdString
'Creates a dataset which will be filled with data from
'dataAdaptor
Dim ds As New DataSet
dataAdaptor.Fill(ds)
'Creates Table which is filled data from dataset
Dim dataTable As New DataTable
dataTable = ds.Tables(0)
'Sets datagrids source to datatable
dgImage.DataSource = dataTable
'binds ds to datgrid
dgImage.DataBind()
|
|
|
|
|
hi all,
I got one reuirement that i need to compare two key's of hash table how can it possible,please try to help me out,
Thanks In Advance
Chadragupta
|
|
|
|
|
plz described in brief
Piyush Vardhan Singh
Programmer
TAS NewDelhi
India
|
|
|
|
|
The keys of a HashTable are stored as object, so you need to cast the keys to the actual type that you are using for key, before you can make a useful comparison between them.
If you are using framework 2, you should be using a Dictionary instead of a HashTable. Then the keys are not stored as object, so you don't have to cast them to use them.
---
single minded; short sighted; long gone;
|
|
|
|
|
|
Hi
how to know session is expired or not.If session is expired then
i want to redirect the user to login page.How can i do this.Please
guide me.
Rahul
|
|
|
|
|
First method
if ( Session["UserId"] == null )
Response.Redirect("Login.aspx");
Second Method
try
{
string UserId = Session["UserId"].ToString();
}
catch(Exception Ex)
{
Response.Redirect("Login.aspx");
}
|
|
|
|
|
Hi Navaneeth
but i have to define somewhere session("userid") somewhere
before writing it on every page. i.e i have to define
on session start event session("userid") or just i have to
write the code on my page.
Rahul
|
|
|
|
|
Obviously, he's assuming you've stored a userId in the session when the user logged in. That is really the most obvious way to keep track of login, and your site obviously supports logging in.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes i have keep userid in session when user login.On each and every page
i have to check session("userid")=="" if its null then its redirecting
to login page after 20 min.
df
|
|
|
|
|
Hi,
The way u need to check whether session is null or not is like below...
rahul.net11 wrote: session("userid")==""
if ( Session["UserId"] == null )
Regards,
Sandeep Kumar.V
|
|
|
|
|
If you didn't want to do it on each and every page, you can create a base page which all of your web pages inherit from and just do it in the base page. That is what I have done.
Ben
|
|
|
|
|
rahul.net11 wrote: i have to define
on session start event session("userid") or just i have to
write the code on my page.
Exactly what Christian Graus said
|
|
|
|
|
Thanks
I tried it it working.
Rahul
|
|
|
|
|
Thanks
I tried it its working.One more query i have
define 10 values in different session and when session get expired
then values in my all session gets null or some session values still
remain in session.Because i am sending user to login page i force
user to enter only its password because i am taking its email id on
first page and putting it in session and then checking its password
using its mail id.If values in session (email) is get expired or not?
Rahul
|
|
|
|
|
When session ends all your session values will be cleared. If you don't want user to reenter email id, you need to store it in some cookies
|
|
|
|
|
Ok Thanks for your help.
Rahul
|
|
|
|
|
i have to populate data table's values in combo box control using c#.net 2.0. so please provide some code for it
|
|
|
|
|
myCombo.DataSource = myTable;
myCombo.DataBind();
Your combo has properties you can set for which column value to use for display and for the value member.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
HI
i am tryin to bind a image file name to an imageurl tag that is stored in a datagrid
But i keep getting the error message: the server tag is not well formed,
how would i alter this so its correct?
<asp:TemplateColumn HeaderText=Products >
<ItemTemplate ><asp:Image runat=server ID=imageHolder imageurl="~/test/<%#databinder.eval(container.dataitem,"imageAddress"))%> " />
</ItemTemplate>
</asp:TemplateColumn>
Any help greatly appreciated
Cheers
boyindie
|
|
|
|
|
<asp:TemplateColumn HeaderText=Products >
<ItemTemplate >
<asp:Image runat="server" ID="imageHolder" imageurl="~/test/<%# Databinder.Eval(Container("DataItem.imageAddress"))%> " />
</ItemTemplate>
</asp:TemplateColumn>
|
|
|
|