|
Protected Sub cmdOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdOk.Click
Dim str As String = ""
str = ConcatAirCode()
cmdOk.OnClientClick = "Done('" & str & "','" & strTextId & "')"
End Sub
I did this in code behind because i need to pass two variables in my Js function Done.
It works but requires two clicks as it is posting the page on the first click.
Any one got the way around it.
|
|
|
|
|
hi guys i'm developing a web application using n-tier archi i.e (4 tiers).
currently i'm facing problem in assigning the values to the labels which is present in a gridview and its a Template field, i'm enclosing the coding part where i'm facing the problem, i would appreciate any suggestion to solve this...
code runs here......
private void l_DataBinding(Object sender, EventArgs e)
{
_objActiveInpatient = new ActiveInpatient();
// get the control that raised this event
Label l = (Label)sender;
// get the containing row
GridViewRow row = (GridViewRow)l.NamingContainer;
// get the raw data value and make it pretty
string RawValue =DataBinder.Eval(row.DataItem,columnName).ToString();
//// I AM GETTING EXCEPTION IN THE ABOVE LINE SAYING DataBinding: 'MediQMBELib.BusinessEntityCollection`1[[MediQMBELib.ActiveInpatientReports.ActiveInpatient, MediQMBELib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' does not contain a property with the name 'PatientName'.
switch (dataType)
{
case "DateTime":
l.Text = String.Format("{0 : d}", DateTime.Parse(RawValue));
break;
case "Double":
l.Text = String.Format("{0 : ###,###,##0.00}",
Double.Parse(RawValue));
break;
case "Int16":
case "Int32":
l.Text = RawValue;
break;
case "String":
l.Text = DataBinder.Eval(row.DataItem,columnName).ToString();
break;
}
}
BUT THE PROBLEM IS THE FILE IT IS REFERRING FOR THE PROPERTY IS NOT CORRECT, AS ITS SEARCHING IN DIFFERENT .CS FILE, I'M UNABLE TO UNDERSTANDING WHY THE CONTROL IS PASSING TO DIFFERENT FILE RATHER THAN THE ACTUAL BUSINESS LAYER FILE...
ONE MORE THING I'D LIKE TO MAKE IT CLEAR THAT I'M GETTING COLLECTION OF OBJECTS i.e 2 ROWS IN THAT ROW.DATAITEM AND I'M TRYING TO ASSIGN IT TO A STRING RAWDATA BUT, I NEED SOLUTION HERE SO THAT I CAN ASSIGN THE TEXT TO THE LABEL....
I WOULD BE VERY HAPPY IF SOME ONE PUTS LIGHT ON THIS......
|
|
|
|
|
Have you checked in the debugger what the type of row.DataItem is ? I think it's probably not what you expect it to be.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
HI Christian thanks for your reply...
i couldn't find the debugger u mentioned.... can you be bit clear on this....
|
|
|
|
|
jmk_cooljack wrote: i couldn't find the debugger u mentioned.... can you be bit clear on this....
It's simple. You have no idea what you're doing. Buy a very basic book on ASP.NET and the IDE and read it. You should not be at a point of working on any remotely functional code if you haven't worked out how to use your tools.
Try googling the word 'breakpoint' in conjuction with VB.NET or C#, whichever you are using.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi
my dear friend i think you didnt check out the next thread which i've posted, but ur reply was to my debugger post..... its k, the type of the dataitem is again the collection class itself so the control is passed to the collection class... now how can i assign the collection values in the lable_databinder method?
|
|
|
|
|
hi
actually the type of Datarow is
{MediQMBELib.BusinessEntityCollection<mediqmbelib.activeinpatientreports.activeinpatient>}
but thats the problem, in rest of the project the get () and set() properties for the fields works fine with the original business layer class but, for this its bit different....
|
|
|
|
|
I am learning about globalization using ASP.NET. Can someone explain what are the differences in behavior by setting culture info in thread vs. in page? Followings are 2 examples:
Setting Culture in Thread
protected override void InitializeCulture()
{
string culture = Request.Form["DropDownList1"];
if (culture==null)
{
culture = "en-US";
}
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
base.InitializeCulture();
}
Setting Culture in Page
protected override void InitializeCulture()
{
string culture = Request.Form["DropDownList1"];
if (culture==null)
{
culture = "en-US";
}
UICulture = culture;
Culture = culture;
base.InitializeCulture();
}
|
|
|
|
|
Mokai wrote: Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
This sets the culture on thread level.
Mokai wrote: UICulture = culture;
Culture = culture;
This sets the culture on Page level
Read more[^]
|
|
|
|
|
Can you elaborate a bit more? From a user's stand point, what are the differences? What does setting culture at the thread level actually mean and what effects does it have? Thanks.
|
|
|
|
|
|
Dim sScriptWindowOpen As String = "<script>window.open('message.htm',null,'left=400, top=100, height=250, width= 250, status=n o, resizable= no, scrollbars= no, toolbar= no, location = no, menubar = no');</script>"
ClientScript.RegisterClientScriptBlock(Me.GetType(), "anything", sScriptWindowOpen)
|
|
|
|
|
Is there any any error showing in the browser ? Did you look for it in the HTML ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Christian Graus,
actually this code put inside the sub button_click, normally it done by button.attribute.add("onclick", javascipt here). However, i have did some filtering before implement the window.open javascript. I have debug it, but it step it without a error and without open the window. I just wonder is it any syntax error in my javascript?
|
|
|
|
|
Have you read the html to see if there's any errors or issues with how the HTML is formed on the client ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I view the HTML page and it does not have that javascript
The html code as follow:
<input type="submit" name="ButtonSave" value="Save without submit" id="ButtonSave" style="width:142px;" />
Maybe you can test the code below, that is the code
Protected Sub ButtonSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
Dim sScriptWindowOpen As String = "<script>window.open('message.htm',null,'left=400, top=100, height=250, width= 250, status=no, resizable= no, scrollbars= no, toolbar= no, location = no, menubar = no');</script>"
ClientScript.RegisterStartupScript(Me.GetType(), "anything", sScriptWindowOpen)
End Sub
modified on Thursday, February 12, 2009 12:06 PM
|
|
|
|
|
Hello,
How do i make a textbox to write on the next line without pushing enter.
The TextMode is multiline. I have tried setting MaxLength but i dosent do anything, also i have set the Rows property to 10-more then 1- but it dosent work.
Help?
|
|
|
|
|
By setting the Wrap property to True ?
MSDN[^]
|
|
|
|
|
no, it only allows the jump to the next line by pressing enter..
|
|
|
|
|
Strange, did you have a look at this -> [^]
|
|
|
|
|
This is what you will do..
.wrapTextBox
{
word-wrap:break-word;
}
<asp:textbox id="wrappedText" runat="server" textmode="MultiLine" rows="5" cssclass="wrapTextBox" xmlns:asp="#unknown">
now thinking about it .. this should work without specifying word-wrap style. Are you having issues on some specific browser?
|
|
|
|
|
Hello,
I have 2 page web and in the first one exist a button that open the second page while firing the click event.
My question is : can i know from the second page web who is the sender(button from page 1) that open the page 2. Can i catch the button name.
dghdfghdfghdfghdgh
|
|
|
|
|
Nothing built in, but you could pass a parameter (querystring) to the page you're calling, letting it know...
|
|
|
|
|
|
i have downloaded a web template.but i dont know how to implement it.
Please tell me procedure for using web templates in asp.net.
|
|
|
|