|
Hi All,
I have a page in which I have used <ifram> in which another page is included. In that <ifram> page there is text box named txtPO. I want to use that txtPO in the parent page and want to store its value in a variable i-e strPO. How is that posible. (ASP.NET and VB.NET) Please explain with example.
|
|
|
|
|
How is the page included?
---
b { font-weight: normal; }
|
|
|
|
|
Page is included in iframe. "iframe"
|
|
|
|
|
Then they are effectively in different windows in the browser. You have to use client side scripting, i.e. Javascript, to access the page and it's elements.
---
b { font-weight: normal; }
|
|
|
|
|
hi,
make a Public Property of that textbox.
then you will be able to retreive its value
Public Property txtName As String
Get
Return strName
End Get
Set
strName = textBox1.text
End Set
End Property
using this way, you can retrieve the value entered in the textbox
thanks,
Kapil Thakur
(Where's there is Kapil , there is a way)
|
|
|
|
|
Dear Kapil I have include that page in iframe. where should i creat public property of that textbox.
With Best Regards
Thankx
|
|
|
|
|
Hi,
Myself imran, I am quite new to dotnet. i am developing web application using asp.net and C#(Visual Studio 2005). i have defined connection string in web-config.
Can any one help me to know How to Access database using this connetion string.
thanks
regards
imran khan
|
|
|
|
|
Welcome to The Code Project.
Please don't post the same question all over the place. Pick the forum that best fits your question.
---
b { font-weight: normal; }
|
|
|
|
|
Please give me ur email address i will send u webconfig file. Modify it and give ur database path there. U will access ur database.
|
|
|
|
|
my mail id is imranafsari@gmail.com.
i have defined connection string in web-Config as
connectionStrings
add name="connstr" providerName="System.Data.SqlClient" connectionString="server=local;database=HFSERVICES;uid=sa;pwd=;"
/connectionStrings
Now i want to access this connection string in Default.aspx.cs
Thanks
-- modified at 1:52 Tuesday 5th December, 2006
-- modified at 1:54 Tuesday 5th December, 2006
regards
imran khan
|
|
|
|
|
|
Hi
How to pass argument from server side to javascript function?
Like
Dim index1 As Integer
index1 = index + 1
'index = e.Item.DataSetIndex()
CType(btn, HtmlInputButton).Attributes.Add("onclick", "mybtn(index1);")
this is my server side code and mybtn is my javascript function.
I want to pass index1 which is my variable as argument in my function.
How to do that?
Thanks
monika
|
|
|
|
|
You can't pass a server side variable as a parameter to a client side script. The server variable and the client script never exist at the same time, and never at the same place.
You have to use the value of the variable and put that in the string:
"mybtn(" & index1.ToString() & ");"
---
b { font-weight: normal; }
|
|
|
|
|
hi,
in <HTML> code of design view.
use the document.getElementById( 'server-control id') to fetch the server-controls value.
if you find out someother way. please let me know also.
thanks,
Kapil Thakur
(Where's there is Kapil , there is a way) - thakur.kapil@gmail.com
|
|
|
|
|
hi
thanks for yr kind response.
But yr logic is not possible in my logic.
I have found anothere solution
CType(btn, HtmlInputButton).Attributes.Add("onclick", "mybtn(" & index1.ToString() & ");")
I hope u r getting.
Thanks
monika
|
|
|
|
|
Invalid postback or callback argument. Event validation is enabled using <pages enableeventvalidation="true"> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
I got this Error when I clicked Button in Repeater control.
I defined <pages enableeventvalidation="false"> in Web.Config And Machine.Config files Still the error is there.
Polease guide.
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
This error is common in ASP.NET 2.0 as by default the EnableEventValidation is set to true for all the web pages. This provides an enhanced security mechanism where each of the event used in a web page must be registered prior to execution. Where ever you are using AJAX or non-registered CallBack methods, ensure to disable this "EnableEventValidation=false". Now you can work freely.
Arun
|
|
|
|
|
I want to show on Column called Sr No in my datagrid. At runtim this column will show values like 1,2,3.... for each selected row based on the records available in dataset. How to acheive this!!!!!!!
Thanks,
Mini Thomas
|
|
|
|
|
you can create an Autoincrement column and seed by 1 and bind with sr. no column.
Be
Bye
|
|
|
|
|
hi,
here is the code to display Sr No. in datagrid. In the following code loadDs is dataset.
if (loadDs.Tables.Count > 0)
{
loadConsultant.Tables[0].Columns.Add(new DataColumn("Sl_NO", System.Type.GetType("System.String")));
foreach (DataTable table in loadConsultant.Tables)
{
int i = 1;
foreach (DataRow row in table.Rows)
{
foreach (DataColumn column in table.Columns)
{
row["Sl_NO"] = i.ToString();
}
i = i + 1;
}
}
}
Regards,
Prya
|
|
|
|
|
Hello Prya,
In ur code how do I bind the row with Datagrid
also there is error on line
foreach (DataColumn column in table.Columns)
{
can u help mi out
Thanks,
Mini Thomas
|
|
|
|
|
hi,
Use the autoincrement column as told by arvind rather than looping through the dataset.
using autoiuncrement column is more efficient than going through loops.
thanks,
Kapil Thakur
(Where's there is Kapil , there is a way)
|
|
|
|
|
Hi!!!
Thanks for attending at my cuestion.
My cuestion is that simple: ¿How can I use CSS with a Multiview Control and some View control within?
It mightbe silly, but I can´t do that. I've googling for a time now and I've founded some examples that apply CSS to make a "tab control" using a Menu control, a Multiview control and view controls, but not interest in that, just in using the CSS with the Multiview and the view.
Greattings, any advice is welcome...
The limits of my language are the limits of my mind
|
|
|
|
|
Hi,
I have got the following problem, maybe one of you guys already ran into it and knows the answer:
I have a Formview bound to a ObjectDataSource for my class [Product]. It contains a Checkboxlist, bound to another ObjectDataSource which gets its Items from my class' [Category] SelectAll() method.
Now every [Product] instance belongs to n categories (Product holds an IList with [Category] instances), and I need to bind them to the CheckboxList's Checked state.
Unfortunately via DataBinding I can only access the SelectedValue (or SelectedIndex) field, which allows only for a single value and can select only one field.
I cannot reach the CheckBoxList via code because evey control within a FormView seems to be completely out of reach. There aren't any visible instances (there is no protected CheckBoxList CheckBoxListCategories anywhere).
So I am completely lost. I hope somebody can help me out of here
--
Jan
|
|
|
|
|
What you want to do exactly i did not got.
If you want to access the checkboxgroup in the formview try
CheckBoxList chkGroup = objFrm.FindControl("objChkGroup") as CheckBoxList ;
and iterate through it.
int index=0;
for(index =0 ; index < chkGroup.Count ; index++)
{
}
I hope this is your problem
|
|
|
|