how to make the data show when i start typing - asp.net

am working on a website using asp.net
but am new to this
i have information stored in database
and then in the form i have the following
code description description (ar)
these are colums of the table in the database
i want the info in the database to show wheni start typing
for example if i write "a" all the words that start with a should show
how can i do that?
and what should i write here
protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
}
??????

Make event listener to your html text field, like
Do an ajax call to server method/action sending your input contents
Query database to get TOP(N) records, containing/starting with text you sent to server
Return strings/nothing to client side
If there are some results found show a tooltip, containing results

you should use a ui framework for this purpose, see this example on knockoutjs

Related

Firebase dynamic link custom params

'm having trouble with the final steps implementing firebase to our unity app, any help would be really really appreciated
The problem involves receiving custom parameters when the app is opened by a dynamic link
The app opens fine, redirects to store etc if needed so that's ok but when I try to use the custom parameter it never holds the desired info but instead returns the fallback url to our website, I'm using the on link received function copied from dynamic link test app.
the outgoing link looks like this - "https://fbb.page.link/PL/?p=XXXXXXXXXX; where XXXXX is the param im looking for
void Start() {
DynamicLinks.DynamicLinkReceived += OnDynamicLink;
}
void OnDynamicLink(object sender, EventArgs args) {
var dynamicLinkEventArgs = args as ReceivedDynamicLinkEventArgs;
Debug.LogFormat("Received dynamic link {0}",
dynamicLinkEventArgs.ReceivedDynamicLink.Url.OriginalString);
}
// Display the dynamic link received by the application.
void OnDynamicLink(object sender, EventArgs args) {
var dynamicLinkEventArgs = args as ReceivedDynamicLinkEventArgs;
Debug.LogFormat("Received dynamic link {0}",
dynamicLinkEventArgs.ReceivedDynamicLink.Url.OriginalString);
}
but the recieved link returns our homepage and not 'p'
Again any help much appreciated
I finally found the reason this wasnt working for me so for anyone searching as this has been troubling us for some time.
In the end it was because I was using a shortened link which was occluding the parameters I needed, once I tried using the original long link it worked straight away
So for cleanliness sake, I use a link to our website plus the required param, the site takes the param and inserts it into a preset long dynamic link url and redirects to that link, this gives us a nice tidy url with the benefits of parameters

Generating an email list from AppMaker Database

I am trying to figure out how I can get database information involving the email column, make an array with all of the emails and then use the "button" feature to populate the "To:" part of an email page.
Any help is appreciated. Very new at this and pointing me on where to get the info would be great. Thanks
I recommend you to run a server script that would query the datasource that has the emails. The script will look something like this:
function getEmails(){
var query = app.models.<yourmodel>.newQuery();
var results = query.run();
var allEmails = [];
if(results.length > 0){
for(var i = 0; i < results.length; i++){
var uniqueEmail = results[i].<emailfieldname>;
allEmails.push(uniqueEmail);
}
}
return allEmails.join();
}
Then add a script to the button widget "onclick" event that will run the server script and manipulate the returned data. Something similar to this:
function poulateToField(response){
<widget path>.text/value = response;
}
google.script.run.withSuccessHandler(poulateToField).getEmails();
The above widget path would be the path to the "To:" widget, which can be a text box, text area, etc. In my case, I used a text area and the path was this "widget.parent.descendants.TextArea1.value"
I hope this helps. If you have more questions, just let me know! :)
P.D. Please don't forget to review the official documentation for a better and more detailed explanation.
you can also use projections to get a list of items (emails) from your datasource. As per this Article https://developers.google.com/appmaker/ui/binding#projections:
Projections let you access properties from records in a datasource's
items list. Access projections with the ..projections.. option in the
advanced binding wizard, or use the projection operator .. in a
binding path. For example, for an Employees datasource with a name
property, #datasources.Employee.items..name returns a list of all
employees' names.
You can check the "Call Scripts" guide which shows you how to send emails using App Maker which is available here https://developers.google.com/appmaker/tutorials/call-scripts/
To use projections and following the above guide, in Step #2 under "Create the UI": Add a text box for the recipient:
c. In the Property Editor, instead of entering the "To" value to the Textbox widget, you can select Binding and bind the widget to the Datasource projections following this path: datasource > items > ..projections.. > Email (name of the datasource field where the emails are located)
For example a projection will look like this: #datasource.items..email
This will automatically bind all emails that are available in your datasource to the text box widget. Then you can complete the guide and emails will be sent to all the email addresses in your datasource. Hope this helps.

Asp.Net Display message instead of loading image for long running process

When i click on button need to display message instead of loading image for long running process.Need to show what is happening in my code behind.Like below stages
Collecting information from database..........
Generating PDF document..............
Sending e-Mail........
Done.
Note:No need to set default time for stages it need to take message from code behind and display.
Please send me any related links.
Thanks in advance.
Check out Easy incremental status updates for long requests
You could easily add a TextBox control and change the Text property by your code behind, in function of what you do.
For example:
private void Loading()
{
txtLoading.Text = "stage1.Collecting information from database";
// PUT CODE TO COLLECT INFORMATION FROM DATABASE HERE
txtLoading.Text += "\r\nstage2.Generating PDF document";
// PUT CODE TO GENERATE PDF DOCUMENT HERE
// ETC ETC
}
Hope it helps :)

Open print dialog for report from code

I am attempting to force open the print dialog so that all the user has to do is set the email address and press ok. I've found multiple tutorials on how to print a report to file or a printer without the print dialog, but that's not what I'm looking for.
Typically to email a report, the user displays the report, clicks the print icon in the tool bar, and then chooses email and sends it. I want to cut out the first two steps automatically.
This is one of my many attempts at doing this so far, but to no avail.
void emailInvoice()
{
Args args;
ReportRun rr;
Report rb;
PrintJobSettings pjs;
CustInvoiceJour record;
;
select record where record.RecId == 5637175089;
args = new Args("SalesInvoice");
args.record(record);
args.parmEnum(PrintCopyOriginal::OriginalPrint);
// Set report run properties
rr = new ReportRun(args,'');
rr.suppressReportIsEmptyMessage(true);
rr.query().interactive(false);
// set report properties
rb = rr.report();
rb.interactive(true);
// set print job settings
pjs = rr.printJobSettings();
pjs.fileName(strfmt("C:\\Users\\gbonzo\\Desktop\\%1.pdf", record.SalesId));
pjs.fitToPage(true);
// break the report info pages using the height of the current printer's paper
pjs.virtualPageHeight(-1);
// force PDF printing
pjs.format(PrintFormat::PDF);
pjs.setTarget(PrintMedium::Mail);
pjs.viewerType(ReportOutputUserType::PDF);
// lock the print job settings so can't be changed
// X++ code int the report may try to change the destination
// to the screen for example but this does not make
// sense when running a report here
pjs.lockDestinationProperties(true);
// Initialize the report
rr.init();
rr.run();
}
Thanks in advance for your help!
Have you tried to develop a RunBase standard dialog class (RunBaseBatchPrintable if you need to select the printer) that get all the dialog fields you need and from there, programatically run the report passing all the desired parameters? I'm prety sure it will work, and probably will left a cleaner code separating the report of the logic needed to the user interaction.
Read an example here:
http://waikeatng.blogspot.com.es/2010/10/using-runbasebatchprintable-class.html
You have to call the prompt() method of the ReportRun class before calling the run() method.
if (rr.prompt())
{
rr.run();
}
The prompt() method will show the print dialog. If you want it easier for your users you could use the SysMailer class, take a look to the quickSend() method.

Loading extJS Combo Remotely not Working

This is my first bash at using extJS, and after a few hours of struggling, some things are working OK, except I have combo lists that I can't filter down to less than 2000 items in edge cases, so I'm trying to page the lists through remotely, but I must be doing something wrong.
My data store and combo look as follows:
var remoteStore = new Ext.data.JsonStore({
//autoLoad : true,
url : 'addition-lists.aspx',
fields : [{name: 'extension_id'}, {name: 'extension'}],
root : 'extensionList',
id : 'remoteStore'
});
.
.
xtype : 'combo',
fieldLabel : 'Remote',
name : 'remote',
displayField : 'extension',
valueField : 'extension_id',
mode : 'remote',
//pageSize : 20,
triggerAction : 'query',
typeAhead : true,
store : remoteStore,
anchor : '95%'
The combo works loading locally, but as soon as I switch to remote it remains blank.
My ASP.NET page returning the JSON is like this:
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.Write(GetRemote());
}
On remote stores the combo defaults its minChars property to 4, so the query only gets sent after typing 4 chars. Setting minChars almost gives the desired behaviour.
I say almost because even if the item sought by autocomplete is in the current page, a new server query still gets sent, defaulting the selection to the first item in the new page.
The way you configured your store above, the result from your ASP script should read something like this:
{"extensionList": [
{"extension_id": 1, "extension": "js"},
{"extension_id": 2, "extension": "aspx"}
]}
If it doesn't look like that, your remote store will not find anything.
You can refer to this question ExtJS combobox problem in IE
Several things. First, when doing this:
remoteStore.loadData(<%= GetRemote() %>);
you are not actually making a remote call from your javascript. You are echoing the result of calling the GetRemote server function directly into the page at render time. Probably not what you intend? If GetRemote is writing out your combo data (and it's working correctly), then you should be able to use a combo setup for local data. If the intention really is to make a remote call, then you need to remove the server tag and load data via the proxy url as shown in several examples that come with Ext.
Another thing is that your Page_Load code doesn't actually show anything about how you are loading, formatting or returning your data. I would suggest viewing source and verifying that your tag is actually being replaced with the data you expect. If/when you switch it to a true remote call to load data then you can use Firebug to inspect your XHR calls and verify the data coming down that way.
You must set a proxy, i.e. set
proxy: new ScriptTagProxy
property for loading 'store' remotely. Look at examples for exact syntax.
EDIT: Please disregard my previous note since you're using JsonStore shortcut.
Try to apply all of these properties to your combo:
typeAhead: true,
typeAheadDelay: 500,
triggerAction: 'all',
selectOnFocus:true,
And please do not do server-side prefetch of records (using loadData). It hurts internal filter very much, so that you stick with filtered records from different prefetches.
On the other hand, if you do prefetch all records on the server-side, why do you need then remote access for your combo anymore?!

Resources