|
|
Hi There,
I am looking for a little help with direction on how to do the above.
Basically I have a sql database which contains a table of properties - this table contains a description col, a group col and the type of custom control to use. The customer has control over this table and can add extra entries to this table, therefore these extra properties need to be displayed in the htlm.
Currently I am creating ASP repeaters in the code behind, as for each of the different groups returned from the table these need to be within a panel that can be collapsed - I have no idea how many different groups will be required - this is why I have to do it in the code behind.
Also within each group, becuase I dont know what type of control I need to add until the data is returned from the database I also add these controls in the code behind.
If this explaination makes any sence to anyone : is there a better way of doing this - as the properties page takes too long to render?
Thanks
Janet
|
|
|
|
|
DixonJM wrote: this table contains a description col, a group col and the type of custom control to use.
Will your table look like this ?
Description Group Control
-------------------------------
A textbox TxtGroup TextBox
DixonJM wrote: Currently I am creating ASP repeaters in the code behind,
If I understood you properly, I don't think the need of a repeater. You can create table's from codebehind by putting HTML code to Response. One more question, if you are making all control dynamic, how you will take value from the control. I think ASP.NET won't maintain state for dynamically created controls ? Is it ?
|
|
|
|
|
Hi there,
My table, in more details, looks like this:-
Description Group Control MinVal MaxVal MaxLength
-----------------------------------------------------------------------
Own site name Main TextBox 1 40 40
Own Site Tel Main TextBox 1 20 20
Own site ID Main NumericText 1 999 3
Area Code Setting NumericText 0 10 2
The main reason I used a repeater is so that I could use the databind method from the above dataset to add my controls in the code behind?
Thx
janet
Sorry above table looks naff - dont know how to add in table as you did in your post?
|
|
|
|
|
Sorry, I don't think that I can help you since I find a better solution than your current one.
|
|
|
|
|
Hi All;
I'm asp.net noob
Please tell my how to make a simple Database Class by Code (C#) with simple CRUD functions, I mean, I do not know hot to connect to databse ansd manipulate it form code (Database is stored in App_Data).
Thanks
|
|
|
|
|
There are loads of samples and tutorials on the microsoft site - you should just go and have a look at some of these.
Also buying a book might not be a bad idea...
|
|
|
|
|
if u want to retrive data from the database when u click on the, for example, search button, double click on the button and wite the following code behind it to establish connection
**********************************************************
String strConnection;
strConnection = "server=localhost;User ID=sa;Password=sasa;database=rescue15";
SqlConnection conn = new SqlConnection(strConnection);
conn.Open();
*********************************************************
|
|
|
|
|
if u want to retrive data from the database when u click on the, for example, search button, double click on the button and wite the following code behind it to establish connection
**********************************************************
String strConnection;
strConnection = "server=localhost;User ID=sa; password=sasa;database=rescue15";
SqlConnection conn = new SqlConnection(strConnection);
conn.Open();
*********************************************************
|
|
|
|
|
HI!
A TextBox Just Accept Integer values i.e 123 using asp.net and vb.net
|
|
|
|
|
fmlove wrote: A TextBox Just Accept Integer values i.e 123 using asp.net and vb.net
Is that a TextBox Problem ?
|
|
|
|
|
Well, If I get you correctly; you are interested in having a textbox which only accepts integer values. Am I rite?
If so, you can use the following code.
Hi,
this following code allows only integers.
<script language="javascript" type="text/javascript">
function intOnly(i)
{
if(i.value.length>0)
{
i.value = i.value.replace(/[^\d]+/g, '');
}
}
</script>
<asp:TextBox id="TextBox1" style="Z-INDEX: 102; LEFT: 240px; POSITION: absolute; TOP: 152px" Runat="server" onChange="intOnly(this);" onKeyUp="intOnly(this);" onKeyPress="intOnly(this);"></asp:TextBox>
|
|
|
|
|
Thanx for This Kindness.............
|
|
|
|
|
hi
i want to know how to hide the values in query string in ASP.net.
here i want to send the values from one page to another page through query
string with out explicitly visible the values in the query string. i want
the solution with the response.redirect method.
example : www.mysite.com/member.aspx?id=123&name=coco
but i wan the link is www.mysite.com/member.aspx only.
I dont want use Session, or cache.this will make heavy my application
if anybody knows please send me the solution.it's very needed to me.
Thank You
Ramakant Singh
|
|
|
|
|
ramakant_1352 wrote: i want to send the values from one page to another page through query
string with out explicitly visible the values in the query string. i want
the solution with the response.redirect method.
Then you could use some URLRewritting techniques. If you can use Server.Transfer() , you can add items to Context. But you can't use this with Response.Redirect since Context only stays in scope until the page is sent to the browser
|
|
|
|
|
Use property for ID and Name
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
Try to encrypt that values and send as query string.
Let suppose you want to send name as Mobi.
Write a function that encrypt that value.
Foreach(char ch in StringName)
{
// convert this to integer a add some decimal. Then add this at the end of string
Convert.ToInt32(ch)+1;
}
The for decrypting you can minus the same value.
God Bless you.
Always do good to others
|
|
|
|
|
Try to send values with html tag.
pozdrav od zUMBI
|
|
|
|
|
use response.redirect method r postback method..
ie response.redirect("") r if ur great in script then use script
vivek nanda
|
|
|
|
|
Hi,
I'm designing a online purchase form... i'm using gridview for this: here is my source code:
<asp:GridView ID="myGridView1" runat="server" Width="483px" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" DataSourceID="AccessDataSource1" AllowPaging="True" OnSelectedIndexChanged="myGridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Sno" HeaderText="SNo" SortExpression="Sno"/>
<asp:TemplateField HeaderText="PartNo">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtPartNo">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Manufacturer">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtMfg">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtQty">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/db1.mdb"
SelectCommand="SELECT [Sno] FROM [RfqInfo]" UpdateCommand="UPDATE [RfqInfo] SET [Partno] = txtPartNo.Text, [mfg] = txtMfg.Text, [qty] = txtQty.Text WHERE [Sno] = Sno">
</asp:AccessDataSource>
below this i hv a "submit button".
whenever user enter values in the textboxes & click on sumit button values should update in the database...
how could I do that??.. Any one please help me. its urgent...
Thanks in Advance.
|
|
|
|
|
DKalepu wrote: whenever user enter values in the textboxes & click on sumit button values should update in the database...
how could I do that??
GridView is having a method called FindControl() which finds the control specified from the grid view. So in your scenario, you need to find each textboxes from grid view and update to DB.
TextBox txt = (TextBox) myGridView1.Rows[i].Cells[1].FindControl("txtPartNo");
This will give you the txtPartNo textbox object. Write code for all other controls like this.
|
|
|
|
|
hi friend
ur tring that method of updating the gridview data to database is applicable only on the gridview event.
and the person who had this problem asking for getting data updated on external button_click to the gridview.
so, see my reply, if u have any confusion @ this
Dont mind please...
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
amit.metkar wrote: ur tring that method of updating the gridview data to database is applicable only on the gridview event.
and the person who had this problem asking for getting data updated on external button_click to the gridview.
Dear,
Could you tell me how you judge this ? And please show me the difference between your and my code ? Only difference what I found is I given a hit, and you given entire code!. Actually my idea is just give a hint, why should I write entire code, it's like I doing his homework.
|
|
|
|
|
there is much more difference in ur code and my code
it is not like ur giving him just the hint and i m giving him the entire code OR homework.
UR CODE -- for the external button click which is not in gridview, so in this situation u can not get row index , this is the biggest problem in ur code, i m not saying that ur code was wrong.
MY CODE -- I get the Row index thro' GridViewRow Object. And one by one i can retrieve all rows and their cells values.
Amit Metkar
3i-infotech, Mumbai.
|
|
|
|
|
amit.metkar wrote: UR CODE -- for the external button click which is not in gridview, so in this situation u can not get row index , this is the biggest problem in ur code, i m not saying that ur code was wrong.
Again you are misunderstanding me, I think you are confused with that variable i , right ? I am very lazy to type , so I didn't type the loop That's it. Anyway good suggestion, Thanks
|
|
|
|